Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): deployer higher-level environments, merge workflow #13

Merged
merged 14 commits into from
Mar 1, 2024
14 changes: 7 additions & 7 deletions .github/workflows/.deployer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ on:
type: string

### Typical / recommended
cleanup:
description: Cleanup, too aggressive for higher level environments
default: false
required: false
type: string
directory:
description: Chart directory
default: 'charts/${{ github.event.repository.name }}'
required: false
type: string
environment:
description: Environment name; omit for PRs
required: false
type: string
oc_server:
default: https://api.silver.devops.gov.bc.ca:6443
description: 'OpenShift server'
Expand Down Expand Up @@ -59,14 +58,15 @@ on:
secrets:
oc_namespace:
description: OpenShift namespace
required: false
required: true
oc_token:
description: OpenShift token
required: false
required: true

jobs:
deployer:
name: Deployer
environment: ${{ inputs.environment }}
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.triggers.outputs.triggered }}
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Merge

on:
push:
branches: [main]
paths-ignore:
- '*.md'
- '.github/**'
- '.graphics/**'
- '!.github/workflows/**'
workflow_dispatch:
inputs:
pr_no:
description: "PR-numbered container set to deploy"
type: number
required: true

jobs:
vars:
name: Set Variables
outputs:
pr: ${{ steps.pr.outputs.pr }}
runs-on: ubuntu-22.04
timeout-minutes: 1
steps:
# Get PR number for squash merges to main
- name: PR Number
id: pr
uses: bcgov-nr/action-get-pr@v0.0.1

deploy-test:
name: Deploy (test)
needs: [vars]
uses: ./.github/workflows/.deployer.yml
secrets:
oc_namespace: ${{ secrets.oc_namespace }}
oc_token: ${{ secrets.oc_token }}
with:
environment: test
params: --set global.autoscaling=false
release: test


10 changes: 7 additions & 3 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,20 @@ jobs:
name: Deploys
needs: [builds]
uses: ./.github/workflows/.deployer.yml
secrets: inherit
secrets:
oc_namespace: ${{ secrets.oc_namespace }}
oc_token: ${{ secrets.oc_token }}
with:
params: --set global.autoscaling=false --set Chart.name=${{ github.event.repository.name }} #--set Chart.version=${{ github.event.number }}
params: --set global.autoscaling=false
release: ${{ github.event.number }}

close:
name: Close
needs: [deploys]
uses: ./.github/workflows/.pr-close.yml
secrets: inherit
secrets:
oc_namespace: ${{ secrets.oc_namespace }}
oc_token: ${{ secrets.oc_token }}
with:
cleanup: helm

Expand Down