This directory contains example configurations for integrating the Webflow Pulumi Provider into your CI/CD pipelines.
The Webflow Pulumi Provider supports non-interactive automation in CI/CD pipelines, enabling you to:
- Automate deployments - Run
pulumi up --yeswithout user confirmation - Preview changes - Use
pulumi previewto validate changes before applying - Multi-environment management - Deploy to dev, staging, and production stacks
- Secure credential handling - Use CI/CD secrets for API tokens
- Proper exit codes - Integrate with CI pipeline notifications
- Pulumi Account - Create a free account at pulumi.com
- Webflow API Token - Generate from Webflow Dashboard
- Pulumi Access Token - Generate from Pulumi Console
- Infrastructure Code - Your Pulumi program in
infrastructure/directory
-
Store Secrets in GitHub:
- Go to your repository Settings → Secrets and variables → Actions
- Add
WEBFLOW_API_TOKEN: Your Webflow API token - Add
PULUMI_ACCESS_TOKEN: Your Pulumi access token
-
Create Workflow File:
mkdir -p .github/workflows cp examples/ci-cd/github-actions.yaml .github/workflows/deploy.yml
-
Configure Project Structure:
- Place your Pulumi program in
infrastructure/directory - Ensure
infrastructure/Pulumi.yamlexists with your stack configurations
- Place your Pulumi program in
-
Trigger Deployment:
- Push to
mainbranch to automatically preview and deploy - Or manually trigger with "Run workflow" button
- Push to
-
Store Variables in GitLab:
- Go to Settings → CI/CD → Variables
- Add
WEBFLOW_API_TOKEN: Your Webflow API token - Add
WEBFLOW_API_TOKEN_STAGING: Token for staging environment - Add
WEBFLOW_API_TOKEN_PRODUCTION: Token for production environment - Mark secrets with "Protect variable" checkbox
-
Create CI Configuration:
cp examples/ci-cd/gitlab-ci.yaml .gitlab-ci.yml
-
Configure Project Structure:
- Place your Pulumi program in
infrastructure/directory - Ensure
infrastructure/Pulumi.yamlexists
- Place your Pulumi program in
-
Trigger Pipeline:
- Push to
developto deploy to staging - Push to
mainto create production deployment option - Manually approve production deployment when ready
- Push to
# This runs without prompting for confirmation
pulumi up --yes --stack prodKey Flags:
--yes: Skip confirmation prompts (required for CI/CD)--stack STACKNAME: Select target stack--refresh: Refresh state before deployment (optional)--parallel N: Run operations in parallel (improves speed)
# Preview changes without applying
pulumi preview --stack dev
# If preview looks good, deploy
pulumi up --yes --stack devBenefits:
- See what will change before applying
- Catch configuration errors early
- Better change tracking for compliance
# Example with dev/staging/prod stacks
stages:
- preview # All branches preview against dev
- deploy # develop → staging, main → prod
# Environment-specific configuration
variables:
WEBFLOW_API_TOKEN_DEV: ${{ secrets.WEBFLOW_API_TOKEN_DEV }}
WEBFLOW_API_TOKEN_STAGING: ${{ secrets.WEBFLOW_API_TOKEN_STAGING }}
WEBFLOW_API_TOKEN_PROD: ${{ secrets.WEBFLOW_API_TOKEN_PROD }}Environment Variables:
export WEBFLOW_API_TOKEN=your_api_token
pulumi up --yesPulumi Configuration:
pulumi config set webflow:apiToken $WEBFLOW_API_TOKEN --secretBest Practices: ✅ Store tokens in CI/CD secrets management ✅ Never commit tokens to git ✅ Use environment variables or config files ✅ Verify tokens never appear in logs
Pulumi automatically returns proper exit codes:
- 0: Operation successful
- 1: Operation failed or blocked
- 255: Error occurred (resource errors, API failures)
Example Error Handling:
- name: Deploy
run: pulumi up --yes --stack prod
env:
WEBFLOW_API_TOKEN: ${{ secrets.WEBFLOW_API_TOKEN }}
continue-on-error: true
- name: Notify on Failure
if: failure()
run: echo "Deployment failed - check logs"✅ pulumi up --yes runs without prompts
✅ Exit codes properly indicate success/failure
✅ Output formatted for CI/CD log parsing
Testing:
# Test non-interactive mode locally
pulumi up --yes --stack test-env
echo "Exit code: $?"✅ Credentials retrieved from environment variables ✅ Credentials never logged to output ✅ Follows CI/CD secrets best practices
Verification:
# Confirm no tokens in logs
pulumi up --yes 2>&1 | grep -i "token" || echo "No tokens exposed"Problem: "Invalid API token" error
Error: authentication failed - invalid token
Solution:
- Verify token is correctly set:
echo $WEBFLOW_API_TOKEN - Check token permissions in Webflow settings
- Ensure token hasn't expired
- Try regenerating token in Webflow dashboard
Problem: Pulumi asks for confirmation despite --yes flag
Please confirm that you want to proceed: (yes/no)
Solution:
- Add
PULUMI_SKIP_CONFIRMATIONS: trueto environment - Verify using
pulumi --versionto confirm CLI version - Check for custom resource providers that override behavior
Problem: Pipeline times out during deployment
Error: operation timed out after 10 minutes
Solution:
- Increase timeout in CI configuration:
timeout-minutes: 30
- Check Webflow API status
- Use
--parallel Nto speed up operations - Consider splitting into smaller stacks
Problem: Token appears in logs
2024-01-15 10:23:45 DEBUG: Using token abc123xyz...
Solution:
- Verify masking in CI platform settings
- Check application code for logging tokens
- Review logs at
~/.pulumi/logs - Use
--suppress-outputsto hide sensitive values
# GitLab CI example with approval gates
deploy_all_sites:
stage: deploy
script:
- cd infrastructure
- npm install
# Deploy main sites
- pulumi up --yes --stack main-sites
# Deploy marketing sites (with approval required)
- pulumi up --yes --stack marketing-sites
# Deploy client sites (requires manual approval)
- pulumi up --yes --stack client-sites
only:
- main
when: manual
environment:
name: production-
Rotate Tokens Regularly
- Regenerate API tokens quarterly
- Update CI/CD secrets immediately
-
Use Environment-Specific Tokens
- Separate tokens for dev/staging/prod
- Limit token permissions to necessary operations
-
Audit Trail
- Keep git history of infrastructure changes
- Monitor Pulumi activity logs
-
Deployment Approvals
- Require manual approval for production
- Use branch protection rules
- Implement code review process
-
Monitoring
- Alert on deployment failures
- Track deployment frequency and success rate
- Monitor API rate limits
- Pulumi Documentation - Automation API
- GitHub Actions Guide
- GitLab CI/CD Guide
- Webflow API Documentation
- Pulumi Automation Best Practices
For issues with:
- Webflow Provider: GitHub Issues
- Pulumi Platform: Pulumi Community Slack
- CI/CD Integration: Consult your platform documentation
| Platform | File | Features | Setup Time |
|---|---|---|---|
| GitHub Actions | github-actions.yaml |
Preview, multi-env, manual approval | 5 min |
| GitLab CI | gitlab-ci.yaml |
Staging/prod, rollback, approval | 5 min |
| Jenkins | Custom | Flexible, requires groovy | 15 min |
| CircleCI | Custom | Orbs-based, modern config | 10 min |
Start with the provided examples and customize for your environment!