Skip to content

chore(deps): update github actions all dependencies #215

chore(deps): update github actions all dependencies

chore(deps): update github actions all dependencies #215

Workflow file for this run

name: PR
on:
pull_request:
merge_group:
concurrency:
# PR open and close use the same group, allowing only one at a time
group: ${{ github.workflow }}-${{ github.event.number }}
cancel-in-progress: true
jobs:
# Enforce conventional commits in PR titles
conventional-commits:
if: github.event_name == 'pull_request'
name: Conventional Commits
runs-on: ubuntu-22.04
steps:
- uses: amannn/action-semantic-pull-request@v5.5.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pr-description-add:
name: PR Description Add
if: github.event_name == 'pull_request'
env:
DOMAIN: apps.silver.devops.gov.bc.ca
PREFIX: ${{ github.event.repository.name }}
runs-on: ubuntu-22.04
permissions:
pull-requests: write
timeout-minutes: 1
steps:
- uses: bcgov-nr/action-pr-description-add@v1.1.2
with:
add_markdown: |
---
Thanks for the PR!
Deployments, as required, will be available below:
- [Frontend](https://${{ env.PREFIX }}-${{ github.event.number }}-frontend.${{ env.DOMAIN }})
- [Backend](https://${{ env.PREFIX }}-${{ github.event.number }}-frontend.${{ env.DOMAIN }}/api)
Please create PRs in draft mode. Mark as ready to enable:
- [Analysis Workflow](https://github.com/${{ github.repository }}/actions/workflows/analysis.yml)
After merge, new images are deployed in:
- [Merge Workflow](https://github.com/${{ github.repository }}/actions/workflows/merge.yml)
# Find initial PR number (for merge queues)
vars:
name: Build and Deploy Vars
outputs:
asg: ${{ steps.deploys.outputs.asg }}
env: ${{ steps.deploys.outputs.env }}
tag: ${{ steps.deploys.outputs.tag }}
runs-on: ubuntu-22.04
steps:
- name: Set Variables
id: deploys
run: |
if [ ${{ github.event_name }} == 'pull_request' ]
then
# Pull request event
asg=false
env=""
tag=${{ github.event.number }}
else
# Merge group event
asg=true
env=test
tag=$(echo ${{ github.event.merge_group.head_ref }} | grep -Eo "queue/main/pr-[0-9]+" | cut -d '-' -f2)
fi
echo "Summary ---"
echo -e "\tAutoscaling: ${asg}"
echo -e "\tEnvironment: ${env}"
echo -e "\tTag (PR no): ${tag}"
echo "asg=${asg}" >> $GITHUB_OUTPUT
echo "env=${env}" >> $GITHUB_OUTPUT
echo "tag=${tag}" >> $GITHUB_OUTPUT
# https://github.com/bcgov-nr/action-builder-ghcr
builds:
name: Builds
needs: [vars]
runs-on: ubuntu-22.04
permissions:
packages: write
strategy:
matrix:
package: [backend, frontend]
include:
- package: backend
triggers: ('backend/')
build_file: ./backend/Dockerfile
build_context: ./backend
- package: frontend
triggers: ('frontend/hydro_alerting/')
build_file: ./frontend/hydro_alerting/Dockerfile
build_context: ./frontend/hydro_alerting
timeout-minutes: 10
steps:
- uses: bcgov-nr/action-builder-ghcr@v2.2.0
with:
keep_versions: 50
package: ${{ matrix.package }}
tag: ${{ needs.vars.outputs.tag }}
tag_fallback: latest
triggers: ('${{ matrix.package }}/')
build_file: ${{ matrix.build_file }}
build_context: ${{ matrix.build_context }}
build-custom:
name: Build Migrations
needs: [vars]
runs-on: ubuntu-22.04
permissions:
packages: write
timeout-minutes: 10
steps:
- uses: bcgov-nr/action-builder-ghcr@v2.2.0
with:
keep_versions: 10
package: alembicmigrations
tag: ${{ needs.vars.outputs.tag }}
tag_fallback: latest
triggers: ('backend/alembic/versions')
build_file: migrations/Dockerfile
build_context: .
# https://github.com/bcgov-nr/action-deployer-openshift
# deploys:
# name: Deploys
# needs: [builds, vars]
# uses: ./.github/workflows/.deploy.yml
# secrets: inherit
# with:
# autoscaling: ${{ needs.vars.outputs.asg }}
# directory: charts/quickstart-openshift
# environment: ${{ needs.vars.outputs.env }}
# tag: ${{ needs.vars.outputs.tag }}
# release: ${{ needs.vars.outputs.tag }}
# # triggers: ('backend/' 'frontend/' 'migrations/' 'charts/')
deploys:
name: Deploys
needs: [builds]
uses: bcgov/quickstart-openshift-helpers/.github/workflows/.deployer.yml@v0.8.0
secrets:
oc_namespace: ${{ secrets.OC_NAMESPACE }}
oc_token: ${{ secrets.OC_TOKEN }}
with:
triggers: ('backend/' 'frontend/' 'migrations/')
directory: charts/alert_author
params:
--set global.secrets.persist=false
--set-string global.oidc_wellknown='${{ vars.OIDC_WELLKNOWN }}'
--set-string global.oidc_client_id='${{ vars.OIDC_CLIENT_ID }}'
--set-string global.oidc_required_roles='${{ vars.OIDC_REQUIRED_ROLES }}'
tests:
name: Tests
if: needs.deploys.triggered == 'true'
needs: [deploys]
uses: ./.github/workflows/.tests.yml
with:
target: ${{ github.event.number }}