feat: 게임 기록에 '가디언 팀이 획득한 경험치량' 추가 #50
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: Eatery Prod Server - CI/CD | |
on: | |
push: | |
branches: [ "main", "develop" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup application properties file for test | |
run: echo "${{ secrets.APPLICATION_PROPERTIES_TEST }}" > ./src/main/resources/application-test.properties | |
- name: Setup environment variables | |
run: echo "${{ secrets.ENV_PROPERTIES_PROD }}" > ./src/main/resources/env.properties | |
- name: Build with Gradle | |
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1 | |
with: | |
arguments: build | |
- name: Upload Jacoco Report | |
if: ${{ !cancelled() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: jacoco-report | |
path: build/reports/jacoco/test/html | |
- name: Docker build and push | |
if: ${{ !failure() }} | |
run: | | |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | |
docker build -t ${{ secrets.DOCKER_REPO_PROD }} -f Dockerfile . | |
docker push ${{ secrets.DOCKER_REPO_PROD }} | |
- name: Executing remote ssh commands with docker compose for Continuous Delivery | |
if: ${{ !failure() }} | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.AWS_EC2_HOST_PROD }} | |
username: ${{ secrets.AWS_EC2_USERNAME }} | |
key: ${{ secrets.AWS_EC2_KEY_PROD }} | |
script: | | |
cd /home/ec2-user/fmr/server-main/ | |
docker-compose down | |
docker pull ${{ secrets.DOCKER_REPO_PROD }} | |
docker-compose up -d |