Skip to content

chore: try out matrix with outputs #264

chore: try out matrix with outputs

chore: try out matrix with outputs #264

Workflow file for this run

name: PR
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
deploys:
env:
CRONJOB: ${{ github.event.repository.name }}-${{ github.event.number }}-cronjob
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
backend: ${{ steps.trigger.outputs.backend }}
database: ${{ steps.trigger.outputs.database }}
frontend: ${{ steps.trigger.outputs.frontend }}
strategy:
matrix:
name: [ backend, database, frontend ]
include:
- name: backend
file: templates/backend.yml
overwrite: true
parameters: -p MIN_REPLICAS=1 -p MAX_REPLICAS=2
verification_path: /api
- name: database
file: templates/database.yml
overwrite: false
- name: frontend
file: templates/frontend.yml
oc_version: 4.13
overwrite: true
parameters: -p MIN_REPLICAS=1 -p MAX_REPLICAS=2
post_rollout: |

Check failure on line 37 in .github/workflows/pr-open.yml

View workflow run for this annotation

GitHub Actions / PR

Invalid workflow file

The workflow is not valid. .github/workflows/pr-open.yml (Line: 37, Col: 27): Unrecognized named-value: 'env'. Located at position 1 within expression: env.CRONJOB
oc create job "frontend-$(date +%s)" --from=cronjob/${{ env.CRONJOB }}
steps:
- uses: actions/checkout@v4
- id: 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 }}
- id: trigger
run: echo "${{ matrix.name }}=${{ steps.deploys.outputs.triggered }}" >> $GITHUB_OUTPUT
results:
name: Results
runs-on: ubuntu-latest
needs: [deploys]
steps:
- run: |
echo "Results: ${{ toJson(needs.deploys.outputs) }}"
echo "Database triggered: ${{needs.deploys.outputs.database}}"
echo "Backend triggered: ${{needs.deploys.outputs.backend}}"
echo "Frontend triggered: ${{needs.deploys.outputs.frontend}}"