Skip to content

[BE] hotfix ๋กœ ์ธํ•œ ์šด์˜์„œ๋ฒ„ ๋ณ€๊ฒฝ ์‚ฌํ•ญ ๊ฐœ๋ฐœ์„œ๋ฒ„์— ์ ์šฉ #78

[BE] hotfix ๋กœ ์ธํ•œ ์šด์˜์„œ๋ฒ„ ๋ณ€๊ฒฝ ์‚ฌํ•ญ ๊ฐœ๋ฐœ์„œ๋ฒ„์— ์ ์šฉ

[BE] hotfix ๋กœ ์ธํ•œ ์šด์˜์„œ๋ฒ„ ๋ณ€๊ฒฝ ์‚ฌํ•ญ ๊ฐœ๋ฐœ์„œ๋ฒ„์— ์ ์šฉ #78

Workflow file for this run

name: Backend develop CI/CD
on:
workflow_dispatch:
pull_request:
branches: [ develop-BE ]
types: [ closed ]
paths: backend/**
permissions:
contents: read
jobs:
build-and-upload:
if: github.event.pull_request.merged
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.SUBMODULE_ACCESS_TOKEN }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: ํ…Œ์ŠคํŠธ ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์„ค์ •
run: |
echo "TEST_JWT_SECRET_KEY=${{ secrets.TEST_JWT_SECRET_KEY }}" >> $GITHUB_ENV
echo "TEST_JWT_EXPIRE_LENGTH=${{ secrets.TEST_JWT_EXPIRE_LENGTH }}" >> $GITHUB_ENV
- name: gradlew ์‹คํ–‰ ๊ถŒํ•œ ๋ถ€์—ฌ
run: chmod +x gradlew
working-directory: backend
- name: Gradle build ์‹œ์ž‘
run: ./gradlew clean build
working-directory: backend
- name: Docker buildx ์„ค์น˜
uses: docker/[email protected]
- name: Docker Hub ๋กœ๊ทธ์ธ
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_DEV_USERNAME }}
password: ${{ secrets.DOCKERHUB_DEV_TOKEN }}
- name: Docker Image Build
working-directory: backend
run: docker build --platform linux/arm64/v8 -t mapbefine/mapbefine -f Dockerfile-dev .
- name: Docker Hub Push
run: docker push mapbefine/mapbefine
deploy:
if: github.event.pull_request.merged
runs-on: [ self-hosted, dev ]
needs: build-and-upload
steps:
- name: ์ตœ์‹  Docker Image ๊ฐ€์ ธ์˜ค๊ธฐ
run: |
sudo docker login --username ${{ secrets.DOCKERHUB_DEV_USERNAME }} --password ${{ secrets.DOCKERHUB_DEV_TOKEN }}
sudo docker pull mapbefine/mapbefine:latest
- name: Docker Compose
run: |
cd /home/ubuntu/backend
sudo sh zero-downtime-deploy.sh
sudo docker image prune -af
- name: ์Šฌ๋ž™ ๋ฉ”์‹œ์ง€ ๋ณด๋‚ด๊ธฐ
uses: 8398a7/action-slack@v3
with:
mention: 'here'
if_mention: always
status: ${{ job.status }}
fields: workflow,job,commit,message,ref,author,took
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: always()