Production Deployment
Github Actions Approach
Branch-conditioned CI
# .github/workflows/deploy.yml
name: deploy
on: [push]
jobs:
build:
runs-on: ubuntu-latest
env:
# choose token by branch
WEBFLOW_WORKSPACE_API_TOKEN: ${{ github.ref == 'refs/heads/main' && secrets.WF_TOKEN_PROD || secrets.WF_TOKEN_PREVIEW }}
steps:
- uses: actions/checkout@v4
# write .env for the job
- run: |
cat > .env <<EOF
WEBFLOW_WORKSPACE_API_TOKEN=${WEBFLOW_WORKSPACE_API_TOKEN}
EOF
# patch webflow.json per branch
- if: github.ref == 'refs/heads/main'
run: |
jq '.library.name="Sygnal Library" | .library.id="lib_prod_id"' webflow.json > w.json && mv w.json webflow.json
- if: github.ref != 'refs/heads/main'
run: |
jq '.library.name="Sygnal Library (Preview)" | .library.id="lib_preview_id"' webflow.json > w.json && mv w.json webflow.json
# …build/deploy steps here
Env approach
Last updated