Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/services/tenant-ui/f…
Browse files Browse the repository at this point in the history
…rontend/marked-14.1.0
  • Loading branch information
loneil authored Aug 26, 2024
2 parents e2ca855 + 25afa77 commit 749ff05
Showing 1 changed file with 1 addition and 96 deletions.
97 changes: 1 addition & 96 deletions .github/workflows/on_push_main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,100 +69,6 @@ jobs:
image_tag: ${{ steps.builder.outputs.image_tag }}
image_version: ${{ steps.builder.outputs.image_version }}

check_helm_changes:
runs-on: ubuntu-latest
name: Check for Helm Chart changes
outputs:
helm_changed: ${{ steps.list-changed.outputs.changed }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check for chart changes
id: list-changed
run: |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q "^charts/"; then
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi
update_configs_repo:
runs-on: ubuntu-latest
name: Update Configurations Repo
needs:
- build_ui
- build_acapy
- build_proxy
- check_helm_changes
steps:
- uses: actions/checkout@v4

- name: Checkout services directory from the trust-over-ip-configurations repo
uses: actions/checkout@v4
with:
repository: bcgov/trust-over-ip-configurations
ssh-key: ${{ secrets.DITP_CONFIGS_REPO_SECRET }}
sparse-checkout: |
services
path: trust-over-ip-configurations

- name: Lookup Helm Chart and App versions
id: chart_version
run: |
helm repo add traction https://bcgov.github.io/traction
helm repo update
if [[ "${{ needs.check_helm_changes.outputs.helm_changed }}" == "true" ]]; then
echo "APP_VERSION=$(yq e .appVersion charts/traction/Chart.yaml)" >> $GITHUB_OUTPUT
echo "CHART_VERSION=$(yq e .version charts/traction/Chart.yaml)" >> $GITHUB_OUTPUT
else
echo "APP_VERSION=$(helm search repo traction -ojson | jq '.[0].app_version')" >> $GITHUB_OUTPUT
echo "CHART_VERSION=$(helm search repo traction -ojson | jq '.[0].version')" >> $GITHUB_OUTPUT
fi
- name: Update versions
env:
APP_VERSION: ${{ steps.chart_version.outputs.APP_VERSION }}
CHART_VERSION: ${{ steps.chart_version.outputs.CHART_VERSION }}
IMAGE_TAG: ${{ needs.build_acapy.outputs.image_version }}
run: |
cd trust-over-ip-configurations
yq e -i '.appVersion = env(APP_VERSION)' services/traction/charts/dev/Chart.yaml
yq e -i '.version = env(CHART_VERSION)' services/traction/charts/dev/Chart.yaml
yq e -i '.dependencies[0].version = env(CHART_VERSION)' services/traction/charts/dev/Chart.yaml
yq e -i '.traction.acapy.image.tag = env(IMAGE_TAG)' services/traction/charts/dev/values.yaml
yq e -i '.traction.tenant_proxy.image.tag = env(IMAGE_TAG)' services/traction/charts/dev/values.yaml
yq e -i '.traction.ui.image.tag = env(IMAGE_TAG)' services/traction/charts/dev/values.yaml
- name: Commit and Push to trust-over-ip-configurations Repo
run: |
cd trust-over-ip-configurations
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add services/traction/charts/dev/values.yaml services/traction/charts/dev/Chart.yaml
git commit -m "Update chart version and image tags" || echo "No changes to commit"
git push origin main
- uses: convictional/[email protected]
id: workflow-trigger
with:
owner: bcgov
repo: trust-over-ip-configurations
github_token: ${{ secrets.DITP_CONFIGS_REPO_TOKEN }}
workflow_file_name: gitops_sync.yaml

- name: Trigger ArgoCD Sync of bc0192-dev-traction
uses: OpsVerseIO/[email protected]
if: needs.check_helm_changes.outputs.helm_changed != 'true' && steps.workflow-trigger.outputs.conclusion == 'success'
with:
address: gitops-shared.apps.silver.devops.gov.bc.ca
token: ${{ secrets.DITP_GITOPS_ARGO_SECRET}}
action: sync
appName: "bc0192-dev-traction"

deploy_dev:
name: Deploy Dev
environment: development
Expand All @@ -171,8 +77,7 @@ jobs:
- build_ui
- build_acapy
- build_proxy
- check_helm_changes
if: ${{ needs.check_helm_changes.outputs.helm_changed == 'true' && contains(needs.*.result, 'success') && !(contains(needs.*.result, 'failure')) && (github.repository_owner == 'bcgov') }}
if: ${{ contains(needs.*.result, 'success') && !(contains(needs.*.result, 'failure')) && (github.repository_owner == 'bcgov') }}
steps:
- uses: actions/checkout@v4

Expand Down

0 comments on commit 749ff05

Please sign in to comment.