Workers Sites Github Branch

I need to use a specific github branch as the bucket source of the wrangler deployment. Does anybody know if this is possible at all?

I’m using Github Actions to deploy the site to a cloudflare-site branch within github so my Hugo site structure is on one branch and the published website is on another

I’m thinking something like the below may be possible but it fails

[site]
bucket = “cloudflare-site”
entry-point = “workers-site”

I am doing something similar, but let me understand a bit more…

You have the actual source on a branch, let’s call it hugo-site, which is then compiled and outputs to a secondary one static-site, which is then deployed?

Yeah pretty much.

I have my master branch which is the layouts, content, images, archetypes and themes which during the HUgo build gets deployed to the other branch for the actual generated site. I need this branch to deploy via Cloudflare workers. At the moment, I can do the deployment manually on my PC and push the public site up to github which then successfully deploys the site, but i’m trying to remove the need for having a device/VM with hugo and git installed

I would personally do two different GitHub Actions.

name: Hugo Site

on:
  push:
    branches:
    - hugo-site

jobs:
  build:
    runs-on: ubuntu-latest
    name: Build
    steps:
    // all the build steps
name: Deploy to Workers

on:
  push:
    branches:
    - static-site

jobs:
  deploy:
    runs-on: ubuntu-latest
    name: Deploy
    steps:
    // all the Cloudflare Workers steps
2 Likes