Merge branch 'dev_backend' into release/v3.0_luca #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: NAAGA BACKEND RELEASE SERVER MERGE CI/CD | |
on: | |
push: | |
branches: | |
- release/** | |
paths: | |
- backend/** | |
jobs: | |
github_actions_setting: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 📂 프로젝트 파일 가져오는 중... 📂 | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: ☕️ 깃허브 액션에 JDK 17 적용시키는 중... ☕️ | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
- name: 🐘 Gradle 세팅 중... 🐘 | |
uses: gradle/gradle-build-action@v2.6.0 | |
- name: ⚙️ Gradle 로 JAR 파일 테스트 및 빌드 중... ⚙️ | |
run: | | |
cd backend | |
./gradlew clean bootJar -Dspring.profiles.active=test | |
- name: 🐳 도커 세팅 중... 🐳 | |
uses: docker/setup-buildx-action@v2.9.1 | |
- name: 🐳 도커 허브에 로그인 중... 🐳 | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_ACCESSTOKEN }} | |
- name: 🐳 도커 이미지 빌드 중... 🐳 | |
run: | | |
cd backend | |
docker build --platform linux/arm64/v8 -t ${{ secrets.DOCKERHUB_REPOSITORY }}/${{ secrets.DOCKERHUB_APPNAME }} -f Dockerfile-prod . | |
- name: 🐳 도커 허브에 Push 중... 🐳 | |
run: docker push ${{ secrets.DOCKERHUB_REPOSITORY }}/${{ secrets.DOCKERHUB_APPNAME }} | |
naaga_prod_ec2_deploy: | |
needs: github_actions_setting | |
runs-on: naaga | |
steps: | |
- name: 🙏 쉘 스크립트 실행 중 ... 🙏 | |
run: | | |
cd /home/ubuntu/prod | |
sudo ./deploy_prod.sh |