-
Notifications
You must be signed in to change notification settings - Fork 3
46 lines (39 loc) · 1.47 KB
/
go.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
# 1. Test & Build about GO Code
# 2. Push the Container image of Operator Controller to NCP Registry
# 3. Up-to-date kustomization file to cicd repository
name: cicd
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Get version
id: image
run: |
VERSION=$(echo ${{ github.sha }} | cut -c1-8)
echo VERSION=$VERSION
echo "::set-output name=version::$VERSION"
# kustomize 명령을 가져온다.
- name: Setup Kustomize
uses: imranismail/setup-kustomize@v1
- name: Checkout kustomize repository
uses: actions/checkout@v2
with:
# kubernetes 설정정보 저장소
repository: cloud-club/aviator-cicd
ref: main
# 다른 저장소에 push 하려면 Personal Access Token이 필요.
# token: ${{ secrets.ACTION_TOKEN }}
# 새 이미지 버전으로 파일 수정
- name: Update Kubernetes resources
run: |
cd prd
kustomize edit set image ${{ env.IMAGE_NAME }}:${{ steps.image.outputs.version }}
cat kustomization.yaml
# 수정된 파일 commit & push
- name: Commit files
run: |
git config --global user.email "[email protected]"
git config --global user.name "dev-kimdoyoung"
git commit -am "Update image tag ${{ env.IMAGE_NAME }}:${{ steps.image.outputs.version }}"
git push -u origin main