Skip to content

Build And Add Job to Openshift Prod #37

Build And Add Job to Openshift Prod

Build And Add Job to Openshift Prod #37

name: Build And Add Job to Openshift Prod
on:
workflow_dispatch:
inputs:
RELEASE_VERSION:
required: true
description: The Tag release to PROD.
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
builds:
name: Builds
runs-on: ubuntu-22.04
permissions:
packages: write
timeout-minutes: 10
steps:
- uses: bcgov-nr/[email protected]
with:
package: sris
tag: ${{ github.event.inputs.RELEASE_VERSION }}
tag_fallback: latest
build_file: ./Dockerfile
build_context: .
deploy:
name: Deploy
runs-on: ubuntu-22.04
needs: [builds]
environment: prod # read secrets from prod environment in github.
steps:
- uses: bcgov-nr/[email protected]
with:
oc_server: ${{ secrets.OPENSHIFT_SERVER }}
oc_namespace: ${{ vars.OC_NAMESPACE }}
oc_token: ${{ secrets.OPENSHIFT_TOKEN }}
overwrite: true
penetration_test: false
file: ./openshift/sris-schedule-job.yml
parameters: |
APP_NAME=sris \
TAG=${{ github.event.inputs.RELEASE_VERSION }} \
NAMESPACE=${{ vars.OC_NAMESPACE }} \
CHEFS_SOILS_FORM_ID=${{ secrets.CHEFS_SOILS_FORM_ID }} \
CHEFS_SOILS_API_KEY=${{ secrets.CHEFS_SOILS_API_KEY }} \
CHEFS_SOILS_FORM_VERSION=${{ secrets.CHEFS_SOILS_FORM_VERSION }} \
CHEFS_HV_FORM_ID=${{ secrets.CHEFS_HV_FORM_ID }} \
CHEFS_HV_API_KEY=${{ secrets.CHEFS_HV_API_KEY }} \
CHEFS_HV_FORM_VERSION=${{ secrets.CHEFS_HV_FORM_VERSION }} \
CHEFS_MAIL_FORM_ID=${{ secrets.CHEFS_MAIL_FORM_ID }} \
CHEFS_MAIL_API_KEY=${{ secrets.CHEFS_MAIL_API_KEY }} \
CHEFS_MAIL_FORM_VERSION=${{ secrets.CHEFS_MAIL_FORM_VERSION }} \
CHES_API_OAUTH_SECRET=${{ secrets.CHES_API_OAUTH_SECRET }} \
MAPHUB_USER=${{ secrets.MAPHUB_USER }} \
MAPHUB_PASS=${{ secrets.MAPHUB_PASS }} \
SRC_CSV_ID=${{ secrets.SRC_CSV_ID }} \
SRC_LAYER_ID=${{ secrets.SRC_LAYER_ID }} \
RCV_CSV_ID=${{ secrets.RCV_CSV_ID }} \
RCV_LAYER_ID=${{ secrets.RCV_LAYER_ID }} \
HV_CSV_ID=${{ secrets.HV_CSV_ID }} \
HV_LAYER_ID=${{ secrets.HV_LAYER_ID }} \
WEB_MAP_APP_ID=${{ secrets.WEB_MAP_APP_ID }} \
CHEFS_API_URL=${{ secrets.CHEFS_API_URL }} \
AUTH_URL=${{ secrets.AUTH_URL }} \
CHES_URL=${{ secrets.CHES_URL }} \
LOGLEVEL=${{ secrets.LOGLEVEL }} \
NOTICE_STANDARD_TIME=${{ secrets.NOTICE_STANDARD_TIME }} \
AGOL_UPDATE_FLAG=${{ secrets.AGOL_UPDATE_FLAG }} \
EMAIL_NOTIFY_FLAG=${{ secrets.EMAIL_NOTIFY_FLAG }} \
release:
name: Release
runs-on: ubuntu-22.04
needs: [ builds, deploy ]
steps:
- uses: actions/checkout@v4
name: checkout
- uses: rickstaa/action-create-tag@v1
name: Create Release Tag in Git
with:
tag: "release/${{ github.event.inputs.RELEASE_VERSION }}"
message: "Release version ${{ github.event.inputs.RELEASE_VERSION }}"