-
Notifications
You must be signed in to change notification settings - Fork 6
71 lines (55 loc) ยท 1.64 KB
/
merge.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
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: 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:
runs-on: self-hosted
needs: build-and-upload
if: github.event.pull_request.merged
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/build/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()