Prd environment CD #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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\/workshopb2-group-1.*$/ghcr.io\/kbtg-kampus-classnest-se-java\/workshopb2-group-1:${GITHUB_SHA}/" 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 |