Skip to content

Release - Deploy all from main-3108 to TEST #161

Release - Deploy all from main-3108 to TEST

Release - Deploy all from main-3108 to TEST #161

name: Release - Deploy All
run-name: Release - Deploy all from ${{ inputs.gitRef }} to ${{ inputs.environment }}
on:
workflow_dispatch:
inputs:
gitRef:
description: "Git Ref (e.g. v1.0.0 or v1.0.0-prerelease.1)"
required: true
default: ""
environment:
description: "Environment"
required: true
type: environment
deployCamundaDefinitions:
description: "Deploy Camunda BPMN/DMN from main"
type: boolean
default: true
deployFormioDefinitions:
description: "Deploy Form.io forms from main"
type: boolean
default: true
workflow_call:
inputs:
gitRef:
required: true
type: string
environment:
required: true
type: string
deployCamundaDefinitions:
required: true
type: boolean
deployFormioDefinitions:
required: true
type: boolean
secrets:
SA_TOKEN:
required: true
OPENSHIFT_ENV_NAMESPACE:
required: true
HOST_PREFIX:
required: true
KEYCLOAK_AUTH_URL:
required: true
BCeID_WEB_SERVICE_WSDL:
required: true
SITE_MINDER_LOGOUT_URL:
required: true
ATBC_LOGIN_ENDPOINT:
required: true
ATBC_ENDPOINT:
required: true
BYPASS_APPLICATION_SUBMIT_VALIDATIONS:
required: true
BYPASS_CRA_INCOME_VERIFICATION:
required: true
OPENSHIFT_SIMS_CREDS_NAME:
required: true
FORMS_SECRET_NAME:
required: true
QUEUE_PREFIX:
required: true
API_PORT:
required: true
WEB_PORT:
required: true
env:
NAMESPACE: ${{ secrets.OPENSHIFT_ENV_NAMESPACE }}
BUILD_REF: ${{ inputs.gitRef }}
HOST_PREFIX: ${{ secrets.HOST_PREFIX }}
BUILD_NAMESPACE: ${{ vars.BUILD_NAMESPACE }}
KEYCLOAK_REALM: ${{ vars.KEYCLOAK_REALM }}
IS_FULLTIME_ALLOWED: ${{ vars.IS_FULLTIME_ALLOWED }}
KEYCLOAK_AUTH_URL: ${{ secrets.KEYCLOAK_AUTH_URL }}
BCeID_WEB_SERVICE_WSDL: ${{ secrets.BCeID_WEB_SERVICE_WSDL }}
SITE_MINDER_LOGOUT_URL: ${{ secrets.SITE_MINDER_LOGOUT_URL }}
ATBC_LOGIN_ENDPOINT: ${{ secrets.ATBC_LOGIN_ENDPOINT }}
ATBC_ENDPOINT: ${{ secrets.ATBC_ENDPOINT }}
SWAGGER_ENABLED: true
APPLICATION_ARCHIVE_DAYS: 43
BYPASS_APPLICATION_SUBMIT_VALIDATIONS: ${{ secrets.BYPASS_APPLICATION_SUBMIT_VALIDATIONS }}
BYPASS_CRA_INCOME_VERIFICATION: ${{ secrets.BYPASS_CRA_INCOME_VERIFICATION }}
API_SECRET_NAME: ${{ secrets.OPENSHIFT_SIMS_CREDS_NAME }}
WORKERS_SECRET_NAME: ${{ secrets.OPENSHIFT_SIMS_CREDS_NAME }}
QUEUE_CONSUMERS_SECRET_NAME: ${{ secrets.OPENSHIFT_SIMS_CREDS_NAME }}
FORMS_SECRET_NAME: ${{ secrets.FORMS_SECRET_NAME }}
QUEUE_PREFIX: ${{ secrets.QUEUE_PREFIX }}
API_PORT: ${{ secrets.API_PORT }}
WEB_PORT: ${{ secrets.WEB_PORT }}
jobs:
# Run DB migrations.
run-db-migrations:
name: Run db-migrations
environment: ${{ inputs.environment }}
runs-on: ubuntu-latest
steps:
- name: Print env
run: |
echo Deploy Environment: ${{ inputs.environment }}
echo GIT REF: ${{ inputs.gitRef }}
echo BUILD NAMESPACE: $BUILD_NAMESPACE
- name: Checkout Target Branch
uses: actions/checkout@v3
with:
ref: ${{ inputs.gitRef }}
- name: Log in to OpenShift
run: |
oc login --token=${{ secrets.SA_TOKEN }} --server=${{ vars.OPENSHIFT_CLUSTER_URL }}
- name: Run db-migrations
working-directory: "./devops/"
run: |
make oc-run-db-migrations
# Deploy SIMS API.
deploy-sims-api:
name: Deploy SIMS-API
environment: ${{ inputs.environment }}
runs-on: ubuntu-latest
needs: run-db-migrations
steps:
- name: Print env
run: |
echo Deploy ENVIRONMENT: ${{ inputs.environment }}
echo GIT REF: ${{ inputs.gitRef }}
echo BUILD NAMESPACE: $BUILD_NAMESPACE
- name: Checkout Target Branch
uses: actions/checkout@v3
with:
ref: ${{ inputs.gitRef }}
- name: Log in to OpenShift
run: |
oc login --token=${{ secrets.SA_TOKEN }} --server=${{ vars.OPENSHIFT_CLUSTER_URL }}
- name: Deploy SIMS-API
working-directory: "./devops/"
run: |
make oc-deploy-api
# Deploy workers.
deploy-workers:
name: Deploy Workers
environment: ${{ inputs.environment }}
runs-on: ubuntu-latest
needs: run-db-migrations
steps:
- name: Print env
run: |
echo BUILD ENVIRONMENT: ${{ inputs.environment }}
echo GIT REF: ${{ inputs.gitRef }}
- name: Checkout Target Branch
uses: actions/checkout@v3
with:
ref: ${{ inputs.gitRef }}
- name: Log in to OpenShift
run: |
oc login --token=${{ secrets.SA_TOKEN }} --server=${{ vars.OPENSHIFT_CLUSTER_URL }}
- name: Deploy Workers
working-directory: "./devops/"
run: |
make oc-deploy-workers
# Deploy queue consumers.
deploy-queue-consumers:
name: Deploy Queue Consumers
environment: ${{ inputs.environment }}
runs-on: ubuntu-latest
needs: run-db-migrations
steps:
- name: Print env
run: |
echo Deploy ENVIRONMENT: ${{ inputs.environment }}
echo GIT REF: ${{ inputs.gitRef }}
echo BUILD NAMESPACE: $BUILD_NAMESPACE
- name: Checkout Target Branch
uses: actions/checkout@v3
with:
ref: ${{ inputs.gitRef }}
- name: Log in to OpenShift
run: |
oc login --token=${{ secrets.SA_TOKEN }} --server=${{ vars.OPENSHIFT_CLUSTER_URL }}
- name: Deploy Queue Consumers
working-directory: "./devops/"
run: |
make oc-deploy-queue-consumers
# Deploy Web/Frontend.
deploy-web-frontend:
name: Deploy Web/Frontend
environment: ${{ inputs.environment }}
runs-on: ubuntu-latest
needs: run-db-migrations
steps:
- name: Print env
run: |
echo Deploy ENVIRONMENT: ${{ inputs.environment }}
echo GIT REF: ${{ inputs.gitRef }}
echo BUILD NAMESPACE: $BUILD_NAMESPACE
- name: Checkout Target Branch
uses: actions/checkout@v3
with:
ref: ${{ inputs.gitRef }}
- name: Log in to OpenShift
run: |
oc login --token=${{ secrets.SA_TOKEN }} --server=${{ vars.OPENSHIFT_CLUSTER_URL }}
- name: Deploy Web/Frontend
working-directory: "./devops/"
run: |
make oc-deploy-web
# Deploy Camunda Definitions
deployCamundaDefinitions:
if: ${{ inputs.deployCamundaDefinitions }}
name: Deploy BPMNs and DMNs to Camunda
needs: deploy-sims-api
uses: ./.github/workflows/release-deploy-camunda-definitions.yml
with:
environment: ${{ inputs.environment }}
gitRef: ${{ inputs.gitRef }}
secrets: inherit
# Deploy Formio Definitions
deployFormioDefinitions:
if: ${{ inputs.deployFormioDefinitions }}
name: Deploy Form.io definitions
needs: deploy-sims-api
uses: ./.github/workflows/release-deploy-formio-definitions.yml
with:
environment: ${{ inputs.environment }}
gitRef: ${{ inputs.gitRef }}
secrets: inherit