Skip to content

Commit

Permalink
Update deploy-prod.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Young-Jin Chung <44654482+ychung-mot@users.noreply.github.com>
  • Loading branch information
ychung-mot authored Nov 13, 2024
1 parent 49f39bf commit 5245798
Showing 1 changed file with 65 additions and 65 deletions.
130 changes: 65 additions & 65 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,83 +5,83 @@ on:
types: [published]

jobs:
deploy-silver:
runs-on: ubuntu-22.04
timeout-minutes: 5
permissions:
contents: read
environment:
name: prod
url: https://prod-strdata.apps.silver.devops.gov.bc.ca/

steps:
- uses: hmarr/debug-action@a701ed95a46e6f2fb0df25e1a558c16356fae35a
- uses: actions/checkout@96f53100ba2a5449eb71d2e6604bbcd94b9449b5
with:
ref: main # one source of truth for CI/CD pipeline

- name: Authenticate and set context
uses: redhat-actions/oc-login@9b79eb6d8ec51bce42cb4e77f0a174fc80cf3cb9
with:
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }}
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
namespace: f4a30d-prod
insecure_skip_tls_verify: true

- name: Deploy apps with Helm chart
run: |
vtag=${{ github.ref_name }}
make upgrade \
NAMESPACE=f4a30d-prod \
NAME=strdss-prod \
ENV_NAME=prod \
IMAGE_TAG_FRONTEND=${vtag//v} \
IMAGE_TAG_BACKEND=${vtag//v} \
IMAGE_TAG_HANGFIRE=${vtag//v} \
working-directory: ./helm/main

# deploy-emerald:
# deploy-silver:
# runs-on: ubuntu-22.04
# timeout-minutes: 5
# permissions:
# contents: read
# environment:
# name: prod
# url: https://prod-strdata.apps.silver.devops.gov.bc.ca/

# steps:
# - name: Checkout ArgoCD Repo
# id: gitops
# uses: actions/checkout@v4
# - uses: hmarr/debug-action@a701ed95a46e6f2fb0df25e1a558c16356fae35a
# - uses: actions/checkout@96f53100ba2a5449eb71d2e6604bbcd94b9449b5
# with:
# repository: bcgov-c/tenant-gitops-b0471a
# ref: main
# token: ${{ secrets.GITOPS }} # `GITOPS` is a secret that contains your PAT
# - name: Update Helm Values and Commit
# id: helm
# ref: main # one source of truth for CI/CD pipeline

# - name: Authenticate and set context
# uses: redhat-actions/oc-login@9b79eb6d8ec51bce42cb4e77f0a174fc80cf3cb9
# with:
# openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }}
# openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
# namespace: f4a30d-prod
# insecure_skip_tls_verify: true

# - name: Deploy apps with Helm chart
# run: |
# pwd
# vtag=${{ github.ref_name }}
# make upgrade \
# NAMESPACE=f4a30d-prod \
# NAME=strdss-prod \
# ENV_NAME=prod \
# IMAGE_TAG_FRONTEND=${vtag//v} \
# IMAGE_TAG_BACKEND=${vtag//v} \
# IMAGE_TAG_HANGFIRE=${vtag//v} \
# working-directory: ./helm/main

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: main
token: ${{ secrets.GITOPS }} # `GITOPS` is a secret that contains your PAT
- name: Update Helm Values and Commit
id: helm
run: |
pwd
# # Get current date and time
# datetime=$(date +'%Y-%m-%d %H:%M:%S')
# vtag=${{ github.ref_name }}
# Get current date and time
datetime=$(date +'%Y-%m-%d %H:%M:%S')
vtag=${{ github.ref_name }}
# echo "Image Tag:"
# echo ${vtag//v}
echo "Image Tag:"
echo ${vtag//v}
# # set image tag
# sed -i "s/tag: .*/tag: ${vtag//v} # Image Updated on $datetime/" deploy/prod_values.yaml
# set image tag
sed -i "s/tag: .*/tag: ${vtag//v} # Image Updated on $datetime/" deploy/prod_values.yaml
# # Commit and push the changes
# git config --global user.email "ychung-mot@github.com"
# git config --global user.name "Young-Jin Chung"
# Commit and push the changes
git config --global user.email "ychung-mot@github.com"
git config --global user.name "Young-Jin Chung"
# git add deploy/prod_values.yaml
git add deploy/prod_values.yaml
# pwd
# # Repackage Helm Chart
# cd charts/gitops/charts
pwd
# Repackage Helm Chart
cd charts/gitops/charts
# helm package ../../frontend/
# helm package ../../backend/
# helm package ../../hangfire/
helm package ../../frontend/
helm package ../../backend/
helm package ../../hangfire/
# git add .
git add .
# git commit -m "Update image tag to ${vtag//v} on $datetime"
# git push origin prod
git commit -m "Update image tag to ${vtag//v} on $datetime"
git push origin prod

0 comments on commit 5245798

Please sign in to comment.