GitHub Action to build and deploy deco sites to Cloudflare Workers.
Deploys are proxied through the deco admin API — no Cloudflare secrets needed in your repository.
Add a single workflow to your repo at .github/workflows/deco-deploy.yaml:
name: Deploy
on:
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize, reopened, closed]
permissions:
contents: read
pull-requests: write
jobs:
deploy:
if: github.event.action != 'closed'
runs-on: ubuntu-latest
steps:
- uses: deco-cx/cf-deploy@v0
cleanup-preview:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- uses: deco-cx/cf-deploy/cleanup@v0
with:
site: ${{ github.event.repository.name }}
pr_number: ${{ github.event.pull_request.number }}name: Deploy
on:
push:
branches: [main]
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: deco-cx/cf-deploy@v0| Input | Description | Default |
|---|---|---|
site |
Site name | Repository name |
skip_build |
Skip the build step | false |
build_cmd |
Build command | npm run build |
node_version |
Node.js version | 22 |
checkout |
Clone the repository | true |
admin_url |
Deco admin URL | https://admin.deco.cx |
| Input | Description | Default |
|---|---|---|
site |
Site name | required |
pr_number |
PR number to clean up | required |
admin_url |
Deco admin URL | https://admin.deco.cx |
- The action checks out your code, installs dependencies, and runs
npm run build - The built
dist/worker.jsis uploaded to the deco admin API - The admin validates your
github.tokenagainst the GitHub API to verify the repo belongs to thedeco-sitesorg - The admin uploads the worker to a Cloudflare Workers for Platforms dispatch namespace
- Your site is live at
{site}-tanstack.deco.site
On pull requests, the worker is deployed as {site}--pr-{number} and a comment with the preview URL is posted on the PR. When the PR is closed, the cleanup action deletes the preview worker.
This action uses the auto-generated github.token — no secrets configuration required. The deco admin validates the token to ensure the repository belongs to the deco-sites organization.
MIT