Merge pull request #553 from woowacourse-teams/release/v3.1 #299
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 MERGE CI | |
on: | |
push: | |
branches: | |
- dev_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/[email protected] | |
- name: ⚙️ Gradle 로 JAR 파일 테스트 및 빌드 중... ⚙️ | |
run: | | |
cd backend | |
./gradlew clean bootJar -Dspring.profiles.active=test | |
- name: 🐳 도커 세팅 중... 🐳 | |
uses: docker/[email protected] | |
- 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-dev . | |
- name: 🐳 도커 허브에 Push 중... 🐳 | |
run: docker push ${{ secrets.DOCKERHUB_REPOSITORY }}/${{ secrets.DOCKERHUB_APPNAME }} | |
naaga_dev_ec2_deploy: | |
needs: github_actions_setting | |
runs-on: naaga | |
steps: | |
- name: 🙏 쉘 스크립트 실행 중 ... 🙏 | |
run: | | |
cd /home/ubuntu | |
sudo ./deploy_new.sh | |