Skip to content

[fix] yml 파일 이름 변경 #7

[fix] yml 파일 이름 변경

[fix] yml 파일 이름 변경 #7

Workflow file for this run

name: CD
on:
push:
branches: [ "develop" ]
jobs:
CI:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'
- name: create secret config file
run: |
cd src/main/resources
echo "${{ secrets.APPLICATION_MAIN }}" > ./application.yml
- name: build with gradle
run: |
chmod +x gradlew
./gradlew clean build -x test
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.9.1
- name: Login to Docker Hub
uses: docker/login-action@v2.2.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile-main
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.MAIN_REPONAME }}
CD:
needs: [CI]
runs-on: ubuntu-22.04
steps:
- name: Docker Image Pull and Container Run
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.MAIN_SERVER_HOST }}
username: ${{ secrets.MAIN_USERNAME }}
key: ${{ secrets.MAIN_SERVER_KEY }}
script: |
cd ~
./deploy.sh