-
Notifications
You must be signed in to change notification settings - Fork 3
73 lines (59 loc) ยท 1.89 KB
/
backend-deploy.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: ๋ฐฑ์๋ ๋ฐฐํฌ
on:
push:
branches: [BE/chore/docker-test-2]
permissions:
checks: write
jobs:
build-and-push:
defaults:
run:
working-directory: backend
runs-on: ubuntu-latest
steps:
- name: ์ฒดํฌ์์
uses: actions/checkout@v3
with:
token: ${{ secrets.ACTION_TOKEN }}
submodules: recursive
- name: JDK17 ์ค์น
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Gradle์ ๊ถํ๋ถ์ฌ
run: chmod +x gradlew
- name: Test ๋ฐ ๋น๋ ์คํ
run: ./gradlew build
- name: ๋์ปค ๋ฉํ๋ฐ์ดํฐ ์ค์
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: yigongil/spring
tag-semver: |
{{version}}
{{major}}.{{minor}}
- name: ๋์ปค ํ๋ธ ๋ก๊ทธ์ธ
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: ๋์ปค ์ด๋ฏธ์ง ๋น๋ ํ ํ๋ธ์ ์
๋ก๋
uses: docker/build-push-action@v2
with:
context: .
file: ./backend/Dockerfile
platforms: linux/amd64
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
deploy:
runs-on: self-hosted
if: ${{ needs.build-and-push.result == 'success' }}
needs: [ build-and-push ]
steps:
- name: ๋์ปค ํ / ํ์ผ ์คํ
run: |
cd ~
sudo bash ./deploy.sh