-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (78 loc) · 2.56 KB
/
CD.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
name: k8s CD
on:
# push:
# branches: ["main"]
workflow_dispatch:
env:
dockerimage_tag: ${{ github.sha }}
dockerimage_name: jcy0308/pdf-module
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: --------------- Code Repo ---------------
run: echo "Code Repo"
- name: Code Repo 불러오기
uses: actions/checkout@v4
- name: Docker 준비(1/4) - 메타데이터 생성
id: meta
uses: docker/metadata-action@v5.5.1
with:
images: |
${{ env.dockerimage_name }}
tags: |
${{ env.dockerimage_tag }}
latest
flavor: |
latest=true
- name: Docker 준비(2/4) - QEMU 설정
uses: docker/setup-qemu-action@v3
- name: Docker 준비(3/4) - buildx 설정
uses: docker/setup-buildx-action@v3
- name: Docker 준비(4/4) - 레지스트리 로그인
uses: docker/login-action@v2
with:
username: jcy0308
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker 이미지 빌드+푸시
id: build-and-push
uses: docker/build-push-action@v5.1.0
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
- name: --------------- Config Repo ---------------
run: echo "[Config Repo]"
- name: Config Repo 불러오기
uses: actions/checkout@v4
with:
repository: SystemConsultantGroup/PDF-Converter-Module
ref: main
token: ${{ secrets.ACTION_TOKEN }}
path: PDF-Converter-Module
- name: Kustomize 준비
uses: imranismail/setup-kustomize@v2.0.0
- name: Config Repo 이미지 값 업데이트 (Kustomize)
run: |
cd PDF-Converter-Module/infra/overlay/dev/
kustomize edit set image ${{ env.dockerimage_name }}:${{ env.dockerimage_tag }}
cat kustomization.yaml
- name: Config Repo 변경사항 푸시
run: |
cd PDF-Converter-Module
git config --global user.email "jcy030896@naver.com"
git config --global user.name "chanyeong"
git commit -am "Update image tag"
git push -u origin main
- name: --------------- Clean Up ---------------
run: echo "Clean Up"