/zad-actions:generate-workflowfrom zad-actions
Genereer een GitHub Actions workflow voor een repo die zad-actions deploy/cleanup gebruikt. Gebruik bij 'workflow genereren', 'setup zad', 'integratie', 'voorbeeld workflow'.
Ships in zad-actions. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Generate a complete GitHub Actions workflow for a repository that uses zad-actions for deployment.
/generate-workflow
Or with arguments: /generate-workflow project-id=my-project component=web or /generate-workflow project-id=my-project multi-component
Gather project details. Ask the user for (or accept as arguments):
project-id (required): ZAD project identifier (e.g., regel-k4c)
component (required unless multi-component enabled): Component reference (e.g., web, api, editor)
container-registry (optional, default: ghcr.io): Container registry to use
image-name (optional, default: ${{ github.repository }}): Docker image name
Features to enable (ask the user):
wait-for-ready — wait for deployment health checkqr-code — QR code in PR comment for mobile testingcomment-on-pr — post deployment URL as PR commentclone-from — clone config from existing deployment (e.g., production)path-suffix — append a path to the deployment URL (e.g., /docs/)production-deploy — add production deploy job on push to mainmulti-component — deploy multiple components in a single atomic API call (uses components JSON input instead of component/image)scheduled-cleanup — add a weekly scheduled cleanup job for stale PR environments
Read current action inputs from deploy/action.yml, cleanup/action.yml, and scheduled-cleanup/action.yml to ensure generated workflow uses correct input names and defaults.
Generate the workflow file with the following structure:
name: Deploy
on:
pull_request:
types: [opened, synchronize, reopened, closed]
push:
branches: [main] # only if production-deploy enabled
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
if: github.event.action != 'closed'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v6
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:pr-${{ github.event.number }}
deploy-preview:
if: github.event_name == 'pull_request' && github.event.action != 'closed'
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write # if comment-on-pr
environment:
name: pr-${{ github.event.pull_request.number }}
url: ${{ steps.deploy.outputs.url }}
steps:
- name: Deploy to ZAD
id: deploy
uses: RijksICTGilde/zad-actions/deploy@v4
with:
api-key: ${{ secrets.ZAD_API_KEY }}
project-id: <project-id>
deployment-name: pr-${{ github.event.pull_request.number }}
component: <component>
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:pr-${{ github.event.number }}
If multi-component is enabled, replace the component/image inputs in the deploy step with components:
deploy-preview:
if: github.event_name == 'pull_request' && github.event.action != 'closed'
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write # if comment-on-pr
environment:
name: pr-${{ github.event.pull_request.number }}
url: ${{ steps.deploy.outputs.url }} # first component's URL
steps:
- name: Deploy to ZAD
id: deploy
uses: RijksICTGilde/zad-actions/deploy@v4
with:
api-key: ${{ secrets.ZAD_API_KEY }}
project-id: <project-id>
deployment-name: pr-${{ github.event.pull_request.number }}
components: |
[
{"name": "<component-1>", "image": "${{ env.REGISTRY }}/<image-1>:pr-${{ github.event.number }}"},
{"name": "<component-2>", "image": "${{ env.REGISTRY }}/<image-2>:pr-${{ github.event.number }}"}
]
If multi-component is enabled, use the containers JSON input in the cleanup step instead of container-org/container-name/container-tag:
cleanup-preview:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
permissions:
deployments: write
packages: write
pull-requests: write
steps:
- name: Cleanup
uses: RijksICTGilde/zad-actions/cleanup@v4
with:
api-key: ${{ secrets.ZAD_API_KEY }}
project-id: <project-id>
deployment-name: pr-${{ github.event.pull_request.number }}
delete-github-env: 'true'
delete-github-deployments: 'true'
delete-container: 'true'
containers: |
[
{"org": "${{ github.repository_owner }}", "name": "<image-1>", "tag": "pr-${{ github.event.number }}"},
{"org": "${{ github.repository_owner }}", "name": "<image-2>", "tag": "pr-${{ github.event.number }}"}
]
github-admin-token: ${{ secrets.GITHUB_ADMIN_TOKEN }}
For single-component, use the individual container-org/container-name/container-tag inputs instead:
cleanup-preview:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
permissions:
deployments: write
packages: write
pull-requests: write
steps:
- name: Cleanup
uses: RijksICTGilde/zad-actions/cleanup@v4
with:
api-key: ${{ secrets.ZAD_API_KEY }}
project-id: <project-id>
deployment-name: pr-${{ github.event.pull_request.number }}
delete-github-env: 'true'
delete-github-deployments: 'true'
delete-container: 'true'
container-org: ${{ github.repository_owner }}
container-name: ${{ github.event.repository.name }}
container-tag: pr-${{ github.event.number }}
github-admin-token: ${{ secrets.GITHUB_ADMIN_TOKEN }}
If scheduled-cleanup is enabled, add a separate workflow or job:
scheduled-cleanup:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
permissions:
deployments: write
packages: write
pull-requests: read
steps:
- uses: RijksICTGilde/zad-actions/scheduled-cleanup@v4
with:
api-key: ${{ secrets.ZAD_API_KEY }}
project-id: <project-id>
delete-container: true
container-org: ${{ github.repository_owner }}
container-name: ${{ github.event.repository.name }}
github-admin-token: ${{ secrets.GITHUB_ADMIN_TOKEN }}
Add concurrency: { group: scheduled-cleanup, cancel-in-progress: false } when scheduled-cleanup is included.
Add inline YAML comments explaining:
permissions: block is neededList required secrets the user must configure:
ZAD_API_KEY (always required): a ZAD API token. In the Operations Manager, on the project's Team tab under Leden en tokens, an Admin adds a service account with the role Developer CI and makes a token for it. Developer CI changes deployments that are not on production and reads as Viewer, which covers what the actions read back afterwards (the task and the URLs). For a production deploy use a separate service account, stored as an environment secret: Ops CI when the pipeline only replaces the image of an existing deployment, Ops otherwise. Not a token of a human member, which carries every role that person has. Every token expires (30 days by default, 365 at most), so the secret needs replacing before thenGITHUB_ADMIN_TOKEN (if delete-github-env is used) — PAT with repo admin permissionsOutput the workflow as a code block the user can copy, or write directly to .github/workflows/deploy.yml if the user confirms.
@v4 for zad-actions references (current major version)github-token input defaults to ${{ github.token }} so it doesn't need to be passed explicitlypull-requests: write permission is needed for comment-on-pr and delete-pr-commentpackages: delete permission is needed for container deletion (note: different from packages: write)https://{component}-{deployment}-{project}.rig.prd1.gn2.quattro.rijksapps.nlskip-bot-prs: 'false' to deploy/cleanup if the user wants bot PR deploymentsWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
5 skills in this plugin
/debug-deployDiagnose falende ZAD deployments of cleanup actions. Gebruik bij 'deployment faalt', 'error', 'deploy werkt niet', 'cleanup faalt', 'HTTP error', '401', '403', '404'./lintRun pre-commit linting voor ZAD Actions. Gebruik bij vragen over 'lint', 'pre-commit', 'code quality', 'formatting', 'linting'./releaseMaak een nieuwe release van ZAD Actions. Gebruik bij vragen over 'release', 'versie', 'tag', 'version', 'publiceren', 'uitbrengen'./validate-actionValideer GitHub Actions action.yml bestanden voor ZAD. Gebruik bij vragen over 'validate action', 'action.yml', 'valideer actie', 'GitHub Action controleren', 'inputs outputs check'.zad-actions@overheid-plugins is listed by developer-overheid-nl/skills-marketplace — review the source before installing
npx claudepluginhub developer-overheid-nl/skills-marketplace --plugin zad-actions