-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (62 loc) ยท 1.87 KB
/
reinput.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
name: โจ REINPUT backend DEV CD โจ
env:
PROFILE: dev
DOCKER_HUB_REPOSITORY: ahchjang/reinput # docker ์ค์ ํ ๊ฒ
on:
workflow_dispatch:
push:
branches:
- main
paths:
- ".github/workflows/reinput.yml"
jobs:
backend-docker-build-and-push:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
steps:
- name: โจ Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.ACTION_TOKEN }}
- name: โจ JDK 17 ์ค์
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: โจ Gradle Caching
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: โจ Gradlew ๊ถํ ์ค์
run: chmod +x ./gradlew
- name: โจ Jar ํ์ผ ๋น๋
run: ./gradlew bootJar
- 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: ${{ env.DOCKER_HUB_REPOSITORY }}:latest
backend-docker-pull-and-run:
runs-on: [ self-hosted, dev ]
if: ${{ needs.backend-docker-build-and-push.result == 'success' }}
needs: [ backend-docker-build-and-push ]
steps:
- name: โจ ๋ฐฐํฌ ์คํฌ๋ฆฝํธ ์คํ
run: |
sh /home/ubuntu/deploy.sh