Skip to content

fix: hotffix

fix: hotffix #1

name: Build And Deploy Hotfix PR in Dev namespace
on:
pull_request:
paths-ignore:
- "*.md"
- "docker-compose.yml"
- "renovate.json"
- "COMPLIANCE.yaml"
- ".gitignore"
- ".vscode/**"
- ".diagrams/**"
- ".graphics/**"
- "sysdig/**"
- ".github/workflows/sysdig.yml"
- "clamav-service/**"
branches:
- 'releases/**'
concurrency:
# PR open and close use the same group, allowing only one at a time
group: pr-${{ github.workflow }}-${{ github.event.number }}
cancel-in-progress: true
jobs:
validate:
if: startsWith(github.head_ref, 'hotfix/') && (!github.event.pull_request.head.repo.fork)
name: Validate Branch Naming
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate
shell: bash
run: |
echo "Validating PR, if the head branch name follows the pattern x.x.x_hotfix.x"
# check if the branch name follows the pattern x.x.x_hotfix.x
SUFFIX=$(echo "${{ github.head_ref }}" | sed 's/hotfix\///')
if [[ $SUFFIX =~ ^[0-9]+\.[0-9]+\.[0-9]+_hotfix\.[0-9]+$ ]]; then
echo "Branch naming follows the pattern of hotfix/x.x.x_hotfix.x"
else
echo "Branch naming does not follow the pattern of hotfix/x.x.x_hotfix.x"
exit 1
fi
builds:
if: startsWith(github.head_ref, 'hotfix/') && (!github.event.pull_request.head.repo.fork)
needs: [validate]
uses: ./.github/workflows/.build.yml
check-quota:
name: Check Quota
needs: [builds]
uses: ./.github/workflows/.quota-check.yml
deploys:
name: Deploys
needs: [builds, check-quota]
uses: ./.github/workflows/.deploy.yml
secrets: inherit
with:
autoscaling: false
target: pr-${{ github.event.number }}
tag: pr-${{ github.event.number }}-${{ github.run_number }}
values: "values-hotfix.yaml"
frontend-url: https://pay-transparency-pr-${{ github.event.number }}-frontend.apps.silver.devops.gov.bc.ca
admin-frontend-url: https://pay-transparency-pr-${{ github.event.number }}-admin-frontend.apps.silver.devops.gov.bc.ca
test-integration:
name: Integration
needs: [builds, check-quota, deploys]
uses: ./.github/workflows/.integration.yml
secrets: inherit
with:
backend-external-url: https://pay-transparency-pr-${{ github.event.number }}-backend-external.apps.silver.devops.gov.bc.ca/api
test-e2e:
name: E2E
needs: [builds, check-quota, deploys]
uses: ./.github/workflows/.e2e.yml
secrets: inherit
with:
frontend-url: https://pay-transparency-pr-${{ github.event.number }}-frontend.apps.silver.devops.gov.bc.ca
external-api-base-url: https://pay-transparency-pr-${{ github.event.number }}-backend-external.apps.silver.devops.gov.bc.ca
test-e2e-admin:
name: E2E-Admin
needs: [builds, check-quota, deploys]
uses: ./.github/workflows/.e2e-admin.yml
secrets: inherit
with:
admin-frontend-url: https://pay-transparency-pr-${{ github.event.number }}-admin-frontend.apps.silver.devops.gov.bc.ca