Skip to content

Commit

Permalink
feat(ci): Adjust CI for workflow dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
sylus committed Apr 20, 2024
1 parent 13d06f1 commit bda13fc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 30 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,3 @@ jobs:
branch: main
directory: tenant-gitops
repository: bcgov-c/tenant-gitops-ea352d

- name: Deploy to Test Workflow
uses: peter-evans/workflow_dispatch@v2
with:
workflow: 'Deploy to Test'
token: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy to Prod Workflow
uses: peter-evans/workflow_dispatch@v2
with:
workflow: 'Deploy to Prod'
token: ${{ secrets.GITHUB_TOKEN }}
13 changes: 4 additions & 9 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ name: Deploy to Prod

on:
workflow_dispatch:
inputs:
approve:
description: 'Approve Deploy to Test.'
required: true

jobs:
build:
if: ${{ github.event.inputs.approve == 'true' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master

- name: Export github reference var
run: echo "GITHUB_REFERENCE=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV

- name: Checkout Tenant GitOps Repo
uses: actions/checkout@v3
with:
Expand All @@ -23,16 +22,12 @@ jobs:

- name: Update Argo CD
uses: mikefarah/[email protected]
env:
GITHUB_REFERENCE: ${{ github.event.inputs.tag }}
with:
cmd: |
yq -i '.drupal.tag = strenv(GITHUB_REFERENCE) |
.nginx.tag = strenv(GITHUB_REFERENCE) ' tenant-gitops/helm-drupal/charts/drupal/values-mfin-data-catalogue-prod.yaml
- name: Commit files
env:
GITHUB_REFERENCE: ${{ github.event.inputs.tag }}
run: |
cd tenant-gitops
git config --local user.email "github-actions[bot]@users.noreply.github.com"
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@ name: Deploy to Test

on:
workflow_dispatch:
inputs:
approve:
description: 'Approve Deploy to Test.'
required: true

jobs:
build:
if: ${{ github.event.inputs.approve == 'true' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master

- name: Export github reference var
run: echo "GITHUB_REFERENCE=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV

- name: Checkout Tenant GitOps Repo
uses: actions/checkout@v3
with:
Expand All @@ -24,16 +22,12 @@ jobs:

- name: Update Argo CD
uses: mikefarah/[email protected]
env:
GITHUB_REFERENCE: ${{ github.event.inputs.tag }}
with:
cmd: |
yq -i '.drupal.tag = strenv(GITHUB_REFERENCE) |
.nginx.tag = strenv(GITHUB_REFERENCE) ' tenant-gitops/helm-drupal/charts/drupal/values-mfin-data-catalogue-test.yaml
- name: Commit files
env:
GITHUB_REFERENCE: ${{ github.event.inputs.tag }}
run: |
cd tenant-gitops
git config --local user.email "github-actions[bot]@users.noreply.github.com"
Expand Down

0 comments on commit bda13fc

Please sign in to comment.