-
Notifications
You must be signed in to change notification settings - Fork 3
84 lines (68 loc) ยท 2.37 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
74
75
76
77
78
79
80
81
82
83
84
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: ์๋ธ๋ชจ๋ ์
๋ฐ์ดํธ
run: |
git submodule update --remote --recursive
- name: ์๋ธ๋ชจ๋ ์ปค๋ฐ
run: |
git config --global user.name 'poi1649'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.ACTION_TOKEN }}@github.com/${{ github.repository }}
git commit -am "Auto updated submodule references" && git push || echo "No changes to commit"
- 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