-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (54 loc) · 1.9 KB
/
github-action-dev.yml
File metadata and controls
72 lines (54 loc) · 1.9 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: Update docker image and helm chart
on:
pull_request:
branches:
- develop
types: [closed]
concurrency:
group: web-helm-ci
cancel-in-progress: true
jobs:
docker-image-build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Login to Docker
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET }}
- name: Build Docker image
run: docker build -t geonhyukseo/goormback:${{ github.sha }} .
- name: Push Docker image
run: docker push geonhyukseo/goormback:${{ github.sha }}
web-helm-update:
runs-on: ubuntu-latest
needs: docker-image-build-and-test
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Checkout Helm chart repository
uses: actions/checkout@v2
with:
repository: GoormBread/web-helm
token: ${{ secrets.GH_PAT }}
path: web-helm
- name: Install yq
run: |
sudo apt-get update -y
sudo apt-get install -y jq
- name: Update values.yaml
run: |
cd web-helm
yq eval '.backend.image.tag = "${{ github.sha }}"' -i ./web-helm/values.yaml
- name: Commit and Push changes
env:
GH_PAT: ${{ secrets.GH_PAT }}
run: |
cd web-helm
git config --global user.email "sgh4123@naver.com"
git config --global user.name "SeoGeonhyuk"
git add .
git commit -m "Update backend image tag to ${{ github.sha }} and package Helm chart"
git push https://x-access-token:${GH_PAT}@github.com/GoormBread/web-helm.git main