Skip to content

Commit

Permalink
Merge pull request #846 from bcgov/yj
Browse files Browse the repository at this point in the history
chore: prod deployment - create PR
  • Loading branch information
ychung-mot authored Dec 4, 2024
2 parents fe94d99 + b243bd3 commit 59814dc
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,21 @@ jobs:
with:
repository: bcgov-c/tenant-gitops-b0471a
ref: prod
token: ${{ secrets.GITOPS }} # `GITOPS` is a secret that contains your PAT
token: ${{ secrets.GITOPS }}

- name: Update Helm Values and Commit
id: helm
env:
GITHUB_TOKEN: ${{ secrets.GITOPS }}
run: |
# Ensure GitHub CLI is authenticated
gh auth status || gh auth login --with-token <<< "${{ secrets.GITOPS }}"
# 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
# Update image tag in Helm values
sed -i "s/tag: .*/tag: ${vtag//v} # Image Updated on $datetime/" deploy/prod_values.yaml
# Configure git
Expand All @@ -45,13 +47,9 @@ jobs:
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"
# Create PR to main
gh pr create \
--base main \
--head prod \
--title "Sync prod to main for ${vtag}" \
--body "This PR syncs changes from the `prod` branch to the `main` branch for ${vtag}"

0 comments on commit 59814dc

Please sign in to comment.