Skip to content

Merge pull request #2797 from bcgov/fix/alex-label-fixes-240112 #41

Merge pull request #2797 from bcgov/fix/alex-label-fixes-240112

Merge pull request #2797 from bcgov/fix/alex-label-fixes-240112 #41

## For each release, the value of name, branches, RELEASE_NAME and PR_NUMBER need to be adjusted accordingly
## For each release, update lib/config.js: version and releaseBranch
name: TFRS Dev/Test Jan Release
on:
push:
branches: [ main-release-jan-2024 ]
# paths:
# - frontend/**
# - backend/**
# - security-scan/**
workflow_dispatch:
branches:
- main-release-jan-2024
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unit-test:
name: Run Backend Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/[email protected]
- name: Run coverage report for django tests
uses: kuanfandevops/django-test-action@itvr-django-test
continue-on-error: true
with:
settings-dir-path: "backend/api"
requirements-file: "backend/requirements.txt"
managepy-dir: backend
lint:
name: Linting
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/[email protected]
- name: Frontend Linting
continue-on-error: true
run: |
cd frontend
pwd
npm install
npm run lint
- name: Backend linting
uses: github/super-linter/slim@v4
continue-on-error: true
env:
DEFAULT_BRANCH: ${{ github.ref_name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILTER_REGEX_INCLUDE: .*backend/.*.py
VALIDATE_PYTHON_PYLINT: true
LOG_LEVEL: WARN
# when build branch, the suffix sample is -main-release-jan-2024
# the checkout-ref sample is main-release-jan-2024
build:
name: Build
needs: [unit-test, lint]
uses: ./.github/workflows/build-template.yaml
with:
suffix: -${{ github.ref_name }}
checkout-ref: ${{ github.ref_name }}
secrets:
tools-namespace: ${{ secrets.OPENSHIFT_NAMESPACE_PLATE }}-tools
openshift-server: ${{ secrets.OPENSHIFT_SERVER }}
openshift-token: ${{ secrets.OPENSHIFT_TOKEN }}
# The suffix is -dev-jan, the deployment names are tfrs-backend-dev-jan, tfrs-frontend-dev-jan and etc..
# The image tags are tfrs-backend:dev-main-release-jan-2024, tfrs-frontend:dev-main-release-jan-2024 and etc..
deploy-on-dev:
name: Deploy on Dev
needs: build
uses: ./.github/workflows/branch-deploy-template.yaml
with:
branch-name: ${{ github.ref_name }}
suffix: -dev-jan
env-name: dev
database-service-host-name: tfrs-crunchy-dev-pgbouncer
rabbitmq-vhost: tfrs-jan-vhost
secrets:
tools-namespace: ${{ secrets.OPENSHIFT_NAMESPACE_PLATE }}-tools
namespace: ${{ secrets.OPENSHIFT_NAMESPACE_PLATE }}-dev
openshift-server: ${{ secrets.OPENSHIFT_SERVER }}
openshift-token: ${{ secrets.OPENSHIFT_TOKEN }}
approval-test-deployment:
name: Approval deployment on Test
runs-on: ubuntu-latest
needs: deploy-on-dev
timeout-minutes: 60
steps:
- name: Ask for approval for TFRS Test deployment
uses: trstringer/[email protected]
with:
secret: ${{ github.TOKEN }}
approvers: AlexZorkin,emi-hi,tim738745,kuanfandevops,jig-patel,prv-proton,JulianForeman
minimum-approvals: 1
issue-title: "TFRS main-release-jan-2024 Test Deployment"
deploy-on-test:
name: Deploy on Test
needs: approval-test-deployment
uses: ./.github/workflows/branch-deploy-template.yaml
with:
branch-name: main-release-jan-2024
suffix: -test-jan
env-name: test
database-service-host-name: tfrs-crunchy-test-pgbouncer
rabbitmq-vhost: tfrs-jan-vhost
secrets:
tools-namespace: ${{ secrets.OPENSHIFT_NAMESPACE_PLATE }}-tools
namespace: ${{ secrets.OPENSHIFT_NAMESPACE_PLATE }}-test
openshift-server: ${{ secrets.OPENSHIFT_SERVER }}
openshift-token: ${{ secrets.OPENSHIFT_TOKEN }}