Skip to content

[BE] S3 ๋ฅผ ํ†ตํ•œ Image Upload ๊ธฐ๋Šฅ ๊ตฌํ˜„ #59

[BE] S3 ๋ฅผ ํ†ตํ•œ Image Upload ๊ธฐ๋Šฅ ๊ตฌํ˜„

[BE] S3 ๋ฅผ ํ†ตํ•œ Image Upload ๊ธฐ๋Šฅ ๊ตฌํ˜„ #59

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: jar ํŒŒ์ผ artifact์— ์—…๋กœ๋“œ
uses: actions/upload-artifact@v3
with:
name: BackendApplication
path: backend/build/libs/mapbefine.jar
deploy:
if: github.event.pull_request.merged
runs-on: [ self-hosted, dev ]
needs: build-and-upload
steps:
- name: ๊ตฌ๋ฒ„์ „ jar ํŒŒ์ผ ์‚ญ์ œ
run: rm -rf /home/ubuntu/backend/build/*.jar
- name: jarํŒŒ์ผ artifact์—์„œ ๋‹ค์šด๋กœ๋“œ
uses: actions/download-artifact@v3
with:
name: BackendApplication
path: /home/ubuntu/backend/build/
- name: ๋ฐฐํฌํ•˜๊ธฐ
run: /home/ubuntu/backend/deploy.sh
- 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()