Configure a GitHub Actions matrix build that generates its matrix dynamically from a JSON file in the repository and fans out to per-environment deploy jobs using environment protection rules
Add a setup job that runs a script to read a matrix definition JSON file from the repo and emits it as a job output using echo "matrix=$(cat matrix.json)" >> $GITHUB_OUTPUT
Reference the output in the downstream job's strategy.matrix block using fromJson(needs.setup.outputs.matrix) so the fan-out is driven entirely by the file
Define each matrix entry with an environment field that matches a GitHub environment name; set environment: ${{ matrix.environment }} on the deploy job so protection rules and required reviewers apply per target
Use concurrency: group: deploy-${{ matrix.environment }} with cancel-in-progress: false to prevent concurrent deploys to the same environment while allowing parallel deploys to different environments
Add a matrix.include entry for a canary environment with an extra weight field and conditionally adjust the deploy script behavior based on that field using if: matrix.weight
Wire a summary job using needs: [deploy] with strategy: fail-fast: false so it runs even when individual matrix legs fail and posts a consolidated status to a Slack webhook
Known gotchas
Dynamic matrix outputs must be valid JSON strings; shell quoting issues or newlines in the JSON will silently produce an empty matrix and no jobs will run
GitHub Actions limits a matrix to 256 jobs; exceeding this causes the workflow to fail at parse time, not at runtime
Environment protection rules are evaluated per job, not per workflow; if a matrix job references an environment, each matrix leg independently triggers the required-reviewer gate
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp