Skip to content

Commit

Permalink
Fix test level of action implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
BronzBierd committed Dec 19, 2024
1 parent af52c06 commit 87f5ea2
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions .github/workflows/cd-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,38 +58,38 @@ jobs:
# image_tag: ${{ env.IMAGE_TAG_PREFIX }}-${{ steps.short_sha.outputs.SHORT_SHA }}
# helm_property: /webtag
# helm_paths: web/values.yaml ../develop/values.yaml

- name: Checkout ArgoCD Repo
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
path: gitops

- name: Update Helm Values and Commit
id: helm
if: steps.gitops.outcome == 'success'
shell: bash
run: |
# Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test and
cd gitops/charts
- name: Checkout ArgoCD Repo
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
path: gitops

- name: Update Helm Values and Commit
id: helm
if: steps.gitops.outcome == 'success'
shell: bash
run: |
# Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test and
cd gitops/charts
# Update the Helm values file with the new image tag and version
DATETIME=$(date +'%Y-%m-%d %H:%M:%S') # Get current date and time
# Update the Helm values file with the new image tag and version
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 }}"
for path in "${paths[@]}"; do
sed -i "s/${{ inputs.helm_property }}: .*/${{ inputs.helm_property }}: ${{ inputs.image_tag }} # Image Updated on $DATETIME/" $path
# Stage the changed path immediately for upcoming commit
git add $path
done
# 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 }}"
for path in "${paths[@]}"; do
sed -i "s/${{ inputs.helm_property }}: .*/${{ inputs.helm_property }}: ${{ inputs.image_tag }} # Image Updated on $DATETIME/" $path
# Stage the changed path immediately for upcoming commit
git add $path
done
# Commit and push the changes
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
# Commit and push the changes
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git commit -m "Update API image tag"
git push origin ${{ inputs.gitops_branch }}
git commit -m "Update API image tag"
git push origin ${{ inputs.gitops_branch }}

0 comments on commit 87f5ea2

Please sign in to comment.