-
Notifications
You must be signed in to change notification settings - Fork 6
76 lines (59 loc) ยท 1.86 KB
/
be-merge-dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Backend develop CI/CD
on:
workflow_dispatch:
pull_request:
branches: [ develop ]
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
- 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()