Skip to content

Commit

Permalink
Adjust variables for action level test
Browse files Browse the repository at this point in the history
  • Loading branch information
BronzBierd committed Dec 19, 2024
1 parent 87f5ea2 commit b5b93f3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/cd-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ env:
GITOPS_LICENCE_PLATE: b3c707
ARTIFACTORY_REPO: artifacts.developer.gov.bc.ca
ARTIFACTORY_IMAGE_PATH: sb3c-images
HELM_PATHS: web/values.yaml ../develop/values.yaml
HELM_PROPERTY: /webtag
WEB_BASE_HREF: /

jobs:
Expand Down Expand Up @@ -63,9 +65,9 @@ jobs:
id: gitops
uses: actions/checkout@v4
with:
repository: bcgov-c/tenant-gitops-${{ inputs.licence_plate }}
ref: ${{ inputs.gitops_branch }}
token: ${{ inputs.gitops_ssh_key }} # `GH_PAT` is a secret that contains your PAT
repository: bcgov-c/tenant-gitops-${{ env.GITOPS_LICENCE_PLATE }}
ref: ${{ env.GITOPS_BRANCH }}
token: ${{ secrets.GIT_OPS_SSH_KEY }} # `GH_PAT` is a secret that contains your PAT
path: gitops

- name: Update Helm Values and Commit
Expand All @@ -80,9 +82,9 @@ jobs:
DATETIME=$(date +'%Y-%m-%d %H:%M:%S') # Get current date and time
# Split incoming helm_paths by space into an array and loop through each path update the image tag in each file
IFS=' ' read -r -a paths <<< "${{ inputs.helm_paths }}"
IFS=' ' read -r -a paths <<< "${{ env.HELM_PATHS }}"
for path in "${paths[@]}"; do
sed -i "s/${{ inputs.helm_property }}: .*/${{ inputs.helm_property }}: ${{ inputs.image_tag }} # Image Updated on $DATETIME/" $path
sed -i "s/${{ env.HELM_PROPERTY }}: .*/${{ env.HELM_PROPERTY }}: ${{ env.IMAGE_TAG_PREFIX }}-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" $path
# Stage the changed path immediately for upcoming commit
git add $path
done
Expand All @@ -92,4 +94,4 @@ jobs:
git config --global user.name "GitHub Actions"
git commit -m "Update API image tag"
git push origin ${{ inputs.gitops_branch }}
git push origin ${{ env.GITOPS_BRANCH }}

0 comments on commit b5b93f3

Please sign in to comment.