diff --git a/.github/workflows/cd-web.yaml b/.github/workflows/cd-web.yaml index 9f858126..f6650337 100644 --- a/.github/workflows/cd-web.yaml +++ b/.github/workflows/cd-web.yaml @@ -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: @@ -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 @@ -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 @@ -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 }}