Close
AlgoliaLogoLight
Close full mode
logo

Deploy Gatsby to Cloudflare Workers

Git RepositoryEdit on Github
Last update: an hour ago by aaronammReading time: 2 min

Simple GitHub Actions workflow to Cloudflare Workers

This workflow is very useful for private GitHub repository because GitHub pages does support for free private repo.

name: Publish Gatsby to Cloudflare Workers static page
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
# TODO build with a specific Node.js and Yarn version
- name: Build Gatsby site to a public folder
run: |
yarn install
yarn run build
# https://github.com/cloudflare/wrangler-action
- name: Publish to Couldflare static site
uses: cloudflare/wrangler-[email protected]1.2.0
with:
# GET API token from https://dash.cloudflare.com/profile/api-tokens
apiToken: ${{ secrets.CF_API_TOKEN }}

Useful information

Previous
Deploy .NET app to Azure App Service
Next
Deploy Gatsby to GitHub Pages