Guides
CI/CD Integration
Integrate Vercel Doorman into GitHub Actions and other CI/CD pipelines.
Vercel Doorman is designed for automated deployment pipelines. This guide covers integrating Doorman into your CI/CD workflow.
GitHub Actions
Basic Validation & Deploy
yaml
name: Firewall Deploy
on:
push:
branches: [main]
paths:
- 'vercel-firewall.config.json'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install -g vercel-doorman
- name: Validate configuration
run: vercel-doorman validate
- name: Deploy firewall rules
run: vercel-doorman sync
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}Pull Request Validation
yaml
name: Firewall PR Check
on:
pull_request:
paths:
- 'vercel-firewall.config.json'
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install -g vercel-doorman
- name: Validate configuration
run: vercel-doorman validate --verbose
- name: Show diff
run: vercel-doorman diff --format json
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}Multi-Provider Pipeline
yaml
name: Multi-Provider Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install -g vercel-doorman
- name: Validate all configs
run: |
vercel-doorman validate --config vercel.config.json
vercel-doorman validate --config cloudflare.config.json
- name: Deploy to Vercel
run: vercel-doorman sync --config vercel.config.json --provider vercel
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
- name: Deploy to Cloudflare
run: vercel-doorman sync --config cloudflare.config.json --provider cloudflare
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}Best Practices
Secrets Management
Never commit API tokens. Use your CI provider's secrets management:
- GitHub Actions — Repository secrets or environment secrets
- Vercel — Environment variables in project settings
- GitLab CI — CI/CD variables
Validation Before Deploy
Always validate your configuration before deploying:
bash
vercel-doorman validate --strictThe --strict flag catches warnings that might indicate issues.
Dry Run in PRs
Use --dry-run in pull request checks to preview changes without applying them:
bash
vercel-doorman download --dry-run
vercel-doorman diff --format jsonBackup Before Deploy
Create a backup before applying changes in production:
bash
vercel-doorman backup --name "pre-deploy-$(date +%Y%m%d)"
vercel-doorman syncRelated Pages
- Commands Overview — CLI command reference
- Configuration — Configuration file reference
- Getting Started — Quick setup guide
This content is sourced from the GitHub Wiki.