[BE] S3 ๋ฅผ ํตํ Image Upload ๊ธฐ๋ฅ ๊ตฌํ #59
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: 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() |