Skip to content

chore: try out matrix with outputs #260

chore: try out matrix with outputs

chore: try out matrix with outputs #260

Workflow file for this run

name: PR
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
repo_builds: bcgov/quickstart-openshift
jobs:
deploys:
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
backend_triggered: ${{ steps.is_triggered.outputs.backend.triggered }}
frontend_triggered: ${{ steps.is_triggered.outputs.frontend.triggered }}
database_triggered: ${{ steps.is_triggered.outputs.database.triggered }}
strategy:
matrix:
name: [ database, backend, frontend ]
include:
- name: database
file: templates/database.yml
overwrite: false
- name: backend
file: templates/backend.yml
overwrite: true
parameters: -p MIN_REPLICAS=1 -p MAX_REPLICAS=2
penetration_test: true
verification_path: /api
- name: frontend
file: templates/frontend.yml
oc_version: 4.13
overwrite: true
parameters: -p MIN_REPLICAS=1 -p MAX_REPLICAS=2
penetration_test: false
post_rollout: |
oc create job "frontend-$(date +%s)" --from=cronjob/${{ github.event.repository.name }}-${{ github.event.number }}-cronjob
steps:
- uses: actions/checkout@v4
- name: Deploys
uses: ./
with:
file: ${{ matrix.file }}
name: ${{ matrix.name }}
oc_namespace: ${{ vars.OC_NAMESPACE }}
oc_server: ${{ vars.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
oc_version: ${{ matrix.oc_version }}
overwrite: ${{ matrix.overwrite }}
parameters: -p ZONE=${{ github.event.number }} -p NAME=${{ github.event.repository.name }}
${{ matrix.parameters }}
penetration_test: ${{ matrix.penetration_test }}
post_rollout: ${{ matrix.post_rollout }}
verification_path: ${{ matrix.verification_path }}
- name: Triggered
id: is_triggered
run: |
echo "${{ matrix.name }}.triggered=${{ steps.triggered.outputs.triggered }}" >> $GITHUB_OUTPUT
results:
runs-on: ubuntu-latest
needs: deploys
steps:
- uses: actions/checkout@v4
- name: Results
run: |
echo "Database triggered: ${{needs.deploys.outputs.database_triggered}}"
echo "Backend triggered: ${{needs.deploys.outputs.backend_triggered}}"
echo "Frontend triggered: ${{needs.deploys.outputs.frontend_triggered}}"