-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (60 loc) · 2.09 KB
/
Copy pathwork.yml
File metadata and controls
72 lines (60 loc) · 2.09 KB
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
name: ✨ trioffice CD ✨
on:
push:
branches:
- 'develop'
jobs:
backend-docker-build-and-push:
runs-on: ubuntu-latest
env:
JAVA_TOOL_OPTIONS: "-Duser.timezone=Asia/Seoul"
steps:
- name: ✨ Checkout repository
uses: actions/checkout@v3
with:
ref: refs/heads/develop
- name: application.yml 생성
run: |
mkdir -p src/main/resources
printf "%s" "${{ secrets.APPLICATION_YML }}" > src/main/resources/application.yml
- name: Set up Json file
run: |
mkdir -p src/main/resources/static
echo "${{ secrets.FIREBASE_PRIVATE_KEY_JSON }}" | base64 -d > src/main/resources/static/firebase-key.json
- name: Set up firebase js
run: |
mkdir -p src/main/resources/static
printf "%s" "${{ secrets.FIREBASE_JS }}" | base64 -d > src/main/resources/static/firebase-messaging-sw.js
- name: ✨ JDK 17 설정
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: ✨ Maven Caching
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: ✨ Jar 파일 빌드
run: mvn clean package
- name: ✨ DockerHub에 로그인
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: ✨ Docker Image 빌드 후 DockerHub에 Push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64
tags: ${{ secrets.DOCKER_REPO }}/trioffice:latest
backend-docker-pull-and-run:
runs-on: [ self-hosted, prod ]
needs: [ backend-docker-build-and-push ]
if: ${{ needs.backend-docker-build-and-push.result == 'success' }}
steps:
- name: ✨ 배포 스크립트 실행
run: sh /home/ubuntu/deploy.sh