-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (48 loc) · 1.57 KB
/
deploy-prod.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
name: Deploy Prod Environment
on:
release:
types: [published]
jobs:
deploy-emerald:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Checkout ArgoCD Repo
id: gitops
uses: actions/checkout@v4
with:
repository: bcgov-c/tenant-gitops-b0471a
ref: prod
token: ${{ secrets.GITOPS }} # `GITOPS` is a secret that contains your PAT
- name: Update Helm Values and Commit
id: helm
run: |
# Get current date and time
datetime=$(date +'%Y-%m-%d %H:%M:%S')
vtag=${{ github.ref_name }}
echo "Image Tag:"
echo ${vtag//v}
# Update image tag
sed -i "s/tag: .*/tag: ${vtag//v} # Image Updated on $datetime/" deploy/prod_values.yaml
# Configure git
git config --global user.email "ychung-mot@github.com"
git config --global user.name "Young-Jin Chung"
# Add and commit changes
git add deploy/prod_values.yaml
cd charts/gitops/charts
helm package ../../frontend/
helm package ../../backend/
helm package ../../hangfire/
git add .
git commit -m "Update image tag to ${vtag//v} on $datetime"
git push origin prod
- name: Create Pull Request to Main
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITOPS }}
branch: prod
base: main
title: "Deploy: Sync prod to main"
body: |
This PR syncs changes from the `prod` branch to the `main` branch.
commit-message: "Sync prod changes to main"