chore(ci): gate auto-deploy behind AUTO_DEPLOY_ENABLED repo-variable (#154)

Voorkomt automatische Vercel-deploys op PR-preview en push-naar-main
zolang \`vars.AUTO_DEPLOY_ENABLED == 'true'\` ontbreekt. Default-staat:
auto-deploy UIT, scheelt Actions-minuten op het free-plan.

Handmatig deployen blijft werken via workflow_dispatch (Actions tab →
"Run workflow" → kies preview of production). Die job (\`deploy-manual\`)
is niet aan de flag gebonden.

Aanzetten van auto-deploy: Settings → Secrets and variables → Actions
→ Variables → New repository variable: \`AUTO_DEPLOY_ENABLED\` = \`true\`.

\`changes\` job (path-filter) staat ook achter de flag — die wordt alleen
gebruikt door de twee auto-deploy jobs.

Runbook bijgewerkt met de nieuwe default + uitleg.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Janpeter Visser 2026-05-07 20:17:15 +02:00 committed by GitHub
parent a268df3680
commit 00dbbb4f94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 28 additions and 10 deletions

View file

@ -65,7 +65,8 @@ jobs:
name: Detect deploy-relevant changes
runs-on: ubuntu-latest
needs: ci
if: github.event_name != 'workflow_dispatch'
# Alleen relevant voor auto-deploy jobs; skip wanneer auto-deploy uit staat.
if: vars.AUTO_DEPLOY_ENABLED == 'true' && github.event_name != 'workflow_dispatch'
outputs:
code: ${{ steps.filter.outputs.code }}
steps:
@ -95,8 +96,13 @@ jobs:
name: Deploy Preview (PR)
runs-on: ubuntu-latest
needs: [ci, changes]
# Auto-deploy is uit. Gebruik "Run workflow" (workflow_dispatch) op de
# Actions-pagina voor handmatige deploys. Zet repo-variable
# AUTO_DEPLOY_ENABLED=true in Settings → Secrets and variables → Actions
# om PR-preview-deploys weer in te schakelen.
if: |
github.event_name == 'pull_request' && (
vars.AUTO_DEPLOY_ENABLED == 'true'
&& github.event_name == 'pull_request' && (
(needs.changes.outputs.code == 'true'
&& !contains(github.event.pull_request.labels.*.name, 'skip-deploy'))
|| contains(github.event.pull_request.labels.*.name, 'force-deploy')
@ -128,8 +134,12 @@ jobs:
name: Deploy Production (main)
runs-on: ubuntu-latest
needs: [ci, changes]
# Auto-deploy is uit. Gebruik "Run workflow" (workflow_dispatch) →
# target=production voor handmatige productie-deploys. Zet repo-variable
# AUTO_DEPLOY_ENABLED=true om push-naar-main weer auto te deployen.
if: |
github.ref == 'refs/heads/main'
vars.AUTO_DEPLOY_ENABLED == 'true'
&& github.ref == 'refs/heads/main'
&& github.event_name == 'push'
&& needs.changes.outputs.code == 'true'

View file

@ -122,7 +122,7 @@ Auto-generated on 2026-05-07 from front-matter and headings.
| [Agent-flow: open issues & decision log](./runbooks/agent-flow-pitfalls.md) | `runbooks/agent-flow-pitfalls.md` | active | 2026-05-03 |
| [Auto-PR flow: van story-DONE naar gemergde PR](./runbooks/auto-pr-flow.md) | `runbooks/auto-pr-flow.md` | active | 2026-05-06 |
| [Branch, PR & Commit Strategy](./runbooks/branch-and-commit.md) | `runbooks/branch-and-commit.md` | active | 2026-05-03 |
| [Deploy-controle: triggers, labels, path-filter](./runbooks/deploy-control.md) | `runbooks/deploy-control.md` | active | 2026-05-05 |
| [Deploy-controle: triggers, labels, path-filter](./runbooks/deploy-control.md) | `runbooks/deploy-control.md` | active | 2026-05-07 |
| [Vercel Deployment](./runbooks/deploy-vercel.md) | `runbooks/deploy-vercel.md` | active | 2026-05-03 |
| [MCP Integration — Scrum4Me Tools](./runbooks/mcp-integration.md) | `runbooks/mcp-integration.md` | active | 2026-05-03 |
| [v1.0 Smoke Test Checklist](./runbooks/v1-smoke-test.md) | `runbooks/v1-smoke-test.md` | active | 2026-05-04 |

View file

@ -3,7 +3,7 @@ title: "Deploy-controle: triggers, labels, path-filter"
status: active
audience: [contributor, ai-agent]
language: nl
last_updated: 2026-05-05
last_updated: 2026-05-07
when_to_read: "Vóór een PR mergen, vóór doc-only changes pushen, of bij troubleshooting van Vercel-deployments."
---
@ -14,19 +14,27 @@ vanuit de GitHub Actions workflow `.github/workflows/ci.yml`. Vercel's
eigen Git-integratie staat **uit** (`vercel.json: git.deploymentEnabled:
false`) — de workflow is de enige bron van deploy-truth.
> **Auto-deploy staat momenteel UIT.** Zowel PR-preview als
> push-naar-main-productie deploys zijn afhankelijk van repo-variable
> `AUTO_DEPLOY_ENABLED=true`. Default ontbreekt die variable → beide
> auto-deploy-jobs worden overgeslagen om Actions-minuten te besparen.
> **Handmatig deployen blijft werken** via `workflow_dispatch` (zie
> onderaan). Aanzetten: *Settings → Secrets and variables → Actions →
> Variables → New repository variable → `AUTO_DEPLOY_ENABLED` = `true`*.
---
## Triggers en defaults
| Event | Default-deploy |
|---|---|
| `push` naar `main` | Productie (`vercel deploy --prod`) — alleen als path-filter zegt "code" |
| `pull_request` naar `main` | Preview (`vercel deploy`) — alleen als path-filter zegt "code" en geen `skip-deploy` label |
| `workflow_dispatch` | Handmatig — kies `target: preview \| production` in Actions-tab |
| `push` naar `main` | Productie (`vercel deploy --prod`) — alleen als path-filter zegt "code" **en** `AUTO_DEPLOY_ENABLED=true` |
| `pull_request` naar `main` | Preview (`vercel deploy`) — alleen als path-filter zegt "code", geen `skip-deploy` label **en** `AUTO_DEPLOY_ENABLED=true` |
| `workflow_dispatch` | Handmatig — kies `target: preview \| production` in Actions-tab. Werkt altijd, ongeacht `AUTO_DEPLOY_ENABLED`. |
CI (lint, typecheck, test, build) draait **altijd** op push/PR — ook
voor doc-only changes. Alleen de deploy-jobs respecteren path-filter
en labels.
voor doc-only changes. Alleen de deploy-jobs respecteren path-filter,
labels, en de `AUTO_DEPLOY_ENABLED` flag.
---