Cloudflare Docs
Workers
Visit Workers on GitHub
Set theme to dark (⇧+D)

Deploy button

​​ Background

Deploy buttons let you deploy projects to the Workers platform in under five minutes. The deploy buttons use a Worker to deploy to the platform using the Workers GitHub Action. You can also make your own deploy buttons for your projects to make sharing your work easier.

Try the deploy button below to deploy a GraphQL server:

Select Deploy with Workers to deploy a GraphQL server

Refer to deploy.workers.cloudflare.com for additional projects to deploy.

​​ Create a deploy button for your project

  1. Add a GitHub Actions workflow to your project.

Add a new file to .github/workflows, such as .github/workflows/deploy.yml, and create a GitHub workflow for deploying your project. It should include a set of on events, including at least repository_dispatch, but probably push and maybe schedule as well. Add a step for publishing your project using wrangler-action:

name: Build
on:
push:
pull_request:
repository_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: test
steps:
- uses: actions/checkout@v2
- name: Publish
uses: cloudflare/wrangler-action@1.3.0
  1. Add support for CF_API_TOKEN and CF_ACCOUNT_ID in your workflow:
# Update "Publish" step from last code snippet
- name: Publish
uses: cloudflare/wrangler-action@1.3.0
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
env:
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
  1. Add the Markdown code for your button to your project’s README, replacing the example url parameter with your repository URL.
[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/YOURUSERNAME/YOURREPO)

Select Deploy with Workers to be redirected to the Deploy with Workers page