-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (42 loc) · 1.48 KB
/
prod-cd.yaml
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
name: Prd environment CD
on:
workflow_dispatch:
inputs:
test:
description: '🔦 QA lead already approved'
required: true
type: boolean
sign-off:
description: '📝 Make sure PO sign-off'
required: true
type: boolean
deploy-tag:
description: '🎯 Deploy docker tag'
required: true
type: string
default: c9f6b38c1acd0a7153e42a03b577757262075eb3
jobs:
# ==============
# CD Prd task
# ==============
gitops-prd-versioning:
runs-on: ubuntu-latest
steps:
- name: verify manual input
run: |
{ if [ '${{ inputs.test }}' = 'false' ]; then echo "🔦 QA lead not approve yet"; exit 1; fi }
{ if [ '${{ inputs.sign-off }}' = 'false' ]; then echo "📝 Need PO sign-off"; exit 1; fi }
- name: checkout
uses: actions/checkout@v3
- name: config git
run: |
git --version
git config user.name "robot"
git config user.email "[email protected]"
- name: change image tag
run: |
sed -i -E "s/ghcr.io\/kbtg-kampus-classnest-se-java\/workshop-group-2.*$/ghcr.io\/kbtg-kampus-classnest-se-java\/workshop-group-2:${{ inputs.deploy-tag }}/" infra/gitops/prod/deployment.yml
git add infra/gitops/prod/deployment.yml
git commit -m "[skip actions] 🤖 change prd docker image version to ${{ inputs.deploy-tag }}"
git pull --rebase
git push