Skip to content

Commit

Permalink
Revert "Migrate GHA deployment workflows to ArgoCD triggering" (#1227)
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Polchenko <2119240+i5okie@users.noreply.github.com>
  • Loading branch information
i5okie committed Jun 27, 2024
1 parent 9f67045 commit 756eb9d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 131 deletions.
6 changes: 3 additions & 3 deletions .github/actions/build_acapy/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ outputs:
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
ref: ${{ inputs.ref != '' && inputs.ref || env.GITHUB_REF }}${{ inputs.ref }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
uses: docker/login-action@v2
with:
registry: ${{ inputs.registry}}
username: ${{ inputs.registry_username}}
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/build_ui/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ outputs:
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
ref: ${{ inputs.ref != '' && inputs.ref || env.GITHUB_REF }}${{ inputs.ref }}

Expand Down Expand Up @@ -82,10 +82,10 @@ runs:
npm run build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
uses: docker/login-action@v2
with:
registry: ${{ inputs.registry}}
username: ${{ inputs.registry_username}}
Expand Down
55 changes: 0 additions & 55 deletions .github/workflows/chart_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,58 +48,3 @@ jobs:
config: .github/cr.yaml
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

gitops_update:
runs-on: ubuntu-latest
name: Update GitOps Repo
needs:
- chart-release
steps:
- uses: actions/checkout@v4
- name: Set up Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Add SSH key
env:
DITP_GITOPS_REPO_SECRET: ${{ secrets.DITP_GITOPS_REPO_SECRET }}
run: |
mkdir -p ~/.ssh
echo "$DITP_GITOPS_REPO_SECRET" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: Clone gitops-repo
run: |
git clone git@github.com:bcgov-c/ministry-gitops-ditp.git
cd ministry-gitops-ditp
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Lookup latest chart
id: chart_version
run: |
helm repo add traction https://bcgov.github.io/traction
helm repo update
echo "::set output name=APP_VERSION::$(helm search repo vc-authn-oidc -ojson | jq '.[0].app_version')"
echo "::set output name=CHART_VERSION::$(helm search repo traction -ojson | jq '.[0].version')"
- name: Update test
env:
APP_VERSION: ${{ steps.chart_version.outputs.APP_VERSION }}
CHART_VERSION: ${{ steps.chart_version.outputs.CHART_VERSION }}
run: |
cd ministry-gitops-ditp
yq e -i '.appVersion = $APP_VERSION' services/vc-authn-oidc/charts/test/Chart.yaml
yq e -i '.version = $CHART_VERSION' services/traction/charts/test/Chart.yaml
- name: Update prod
env:
APP_VERSION: ${{ steps.chart_version.outputs.APP_VERSION }}
CHART_VERSION: ${{ steps.chart_version.outputs.CHART_VERSION }}
run: |
cd ministry-gitops-ditp
yq e -i '.appVersion = $APP_VERSION' services/vc-authn-oidc/charts/prod/Chart.yaml
yq e -i '.version = $CHART_VERSION' services/traction/charts/prod/Chart.yaml
- name: Commit and push changes
run: |
cd ministry-gitops-ditp
git add services/traction/charts/test/Chart.yaml services/traction/charts/prod/Chart.yaml
git commit -m "Update chart version"
git push origin main
72 changes: 2 additions & 70 deletions .github/workflows/on_push_main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,74 +69,6 @@ jobs:
image_tag: ${{ steps.builder.outputs.image_tag }}
image_version: ${{ steps.builder.outputs.image_version }}

changed_files:
runs-on: ubuntu-latest
name: Test changed files
outputs:
any_changed: ${{ steps.chart-changes.outputs.any_changed }}
steps:
- uses: actions/checkout@v4
- name: Check for changes in the charts folder
id: chart-changes
uses: tj-actions/changed-files@v44
with:
files: charts/traction/*.*

argo_sync:
runs-on: ubuntu-latest
name: Update GitOps Repo to trigger ArgoCD Sync
needs:
- build_ui
- build_acapy
- build_proxy
- changed_files
if: needs.changed_files.outputs.any_changed != 'true'
steps:
- uses: actions/checkout@v4
- name: Set up Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Add SSH key
env:
DITP_GITOPS_REPO_SECRET: ${{ secrets.DITP_GITOPS_REPO_SECRET }}
run: |
mkdir -p ~/.ssh
echo "$DITP_GITOPS_REPO_SECRET" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: Clone gitops-repo
run: |
git clone git@github.com:bcgov-c/ministry-gitops-ditp.git
cd ministry-gitops-ditp
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Lookup latest chart
id: chart_version
run: |
helm repo add traction https://bcgov.github.io/traction
helm repo update
echo "::set output name=APP_VERSION::$(helm search repo vc-authn-oidc -ojson | jq '.[0].app_version')"
echo "::set output name=CHART_VERSION::$(helm search repo traction -ojson | jq '.[0].version')"
- name: Update values
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 ministry-gitops-ditp
yq e -i '.appVersion = $APP_VERSION' services/vc-authn-oidc/charts/dev/Chart.yaml
yq e -i '.version = $CHART_VERSION' services/traction/charts/dev/Chart.yaml
yq e -i '.traction.acapy.image.tag = $IMAGE_TAG' services/traction/charts/dev/values.yaml
yq e -i '.traction.tenant_proxy.image.tag = $IMAGE_TAG' services/traction/charts/dev/values.yaml
yq e -i '.traction.ui.image.tag = $IMAGE_TAG' services/traction/charts/dev/values.yaml
- name: Commit and push changes
run: |
cd ministry-gitops-ditp
git add services/traction/charts/dev/values.yaml services/traction/charts/dev/Chart.yaml
git commit -m "Update chart version and image tags"
git push origin main
deploy:
name: Deploy Dev
environment: development
Expand All @@ -145,8 +77,8 @@ jobs:
- build_ui
- build_acapy
- build_proxy
- changed_files
if: ${{ needs.changed_files.outputs.any_changed == 'true' && contains(needs.*.result, 'success') && !(contains(needs.*.result, 'failure')) && (github.repository_owner == 'bcgov') }}
if: ${{ always() && contains(needs.*.result, 'success') && !(contains(needs.*.result, 'failure')) && (github.repository_owner == 'bcgov') }}

steps:
- uses: actions/checkout@v4

Expand Down

0 comments on commit 756eb9d

Please sign in to comment.