Skip to content

Instantly share code, notes, and snippets.

@SphericalKat
Created November 20, 2020 21:18
Show Gist options
  • Save SphericalKat/da4135025fc7f11e5e4a317b8f278b93 to your computer and use it in GitHub Desktop.
Save SphericalKat/da4135025fc7f11e5e4a317b8f278b93 to your computer and use it in GitHub Desktop.
name: Deploy site to Cloudflare Workers
on: [push]
jobs:
deploy-main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache yarn dependencies
uses: c-hive/gha-yarn-cache@v1
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- run: yarn install --frozen-lockfile
- run: yarn export
- name: Publish to Cloudflare Workers Sites
run: |
mkdir -p ~/.wrangler/config/
echo "api_token=\"${CF_API_TOKEN}\"" > ~/.wrangler/config/default.toml
yarn wrangler publish --env production
env:
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
CF_ZONE_ID: ${{ secrets.CF_ZONE_ID }}
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment