From c2baf6923b5879182e1cc359af5597fea6e8cc76 Mon Sep 17 00:00:00 2001 From: "claude@clouddev1" Date: Mon, 15 Jun 2026 20:04:48 +0000 Subject: [PATCH] ci(website): Cloudflare Pages deploy via Gitea Actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New .gitea/workflows/website.yaml: on a push to main or website that touches website/**, build the Astro site with pnpm and deploy website/dist to the `relplay` Cloudflare Pages project via wrangler — --branch selects production (main) vs preview (website). Runs on the bare ci-public runner (node present; pnpm via corepack). Pin pnpm with package.json's packageManager for deterministic corepack installs. Requires repo Actions secrets CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID. --- .gitea/workflows/website.yaml | 66 +++++++++++++++++++++++++++++++++++ website/package.json | 1 + 2 files changed, 67 insertions(+) create mode 100644 .gitea/workflows/website.yaml diff --git a/.gitea/workflows/website.yaml b/.gitea/workflows/website.yaml new file mode 100644 index 0000000..ba0e49b --- /dev/null +++ b/.gitea/workflows/website.yaml @@ -0,0 +1,66 @@ +# Build the docs/marketing website and deploy it to Cloudflare Pages. +# +# One Pages project, two branches (no second project, no sub-folders — Pages +# maps a branch to a *subdomain alias*, not a path): +# main → production (the project's production branch → relplay.org) +# website → preview (alias `website..pages.dev`; a custom +# `staging.relplay.org` can be attached to it) +# wrangler treats `--branch=` as a production deploy and any +# other branch as a preview, so a single workflow covers both — the Pages +# project's production branch MUST be set to `main`. +# +# Pure-Node build: the `.cast` recordings are committed, so no cargo/Rust is +# needed here. Runs on the bare `ci-public` runner (node already present; pnpm +# via corepack, pinned by package.json's `packageManager`). No job container — +# unlike the Rust gate, this needs none. +# +# Required Actions secrets (set once in the repo/org settings): +# CLOUDFLARE_API_TOKEN — token with "Cloudflare Pages: Edit" on the account +# CLOUDFLARE_ACCOUNT_ID — the account id that owns the Pages project +name: website +on: + push: + branches: [main, website] + # Only when the site (or this workflow) actually changes — crate-only + # pushes don't redeploy the site. + paths: + - 'website/**' + - '.gitea/workflows/website.yaml' + workflow_dispatch: + +jobs: + deploy: + runs-on: ci-public + defaults: + run: + working-directory: website + steps: + - uses: actions/checkout@v4 + + - name: preflight — toolchain present + run: | + node --version + corepack --version + + - name: enable pnpm (pinned by packageManager) + run: corepack enable + + - name: install + run: pnpm install --frozen-lockfile + + - name: build + run: pnpm build + + - name: deploy to Cloudflare Pages + shell: bash + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + BRANCH: ${{ github.ref_name }} + run: | + set -euo pipefail + # `dist` is relative to website/ (the working-directory). The branch + # name decides production (main) vs preview (anything else). + npx --yes wrangler@4 pages deploy dist \ + --project-name=relplay \ + --branch="$BRANCH" diff --git a/website/package.json b/website/package.json index ea8a667..88150fa 100644 --- a/website/package.json +++ b/website/package.json @@ -3,6 +3,7 @@ "private": true, "type": "module", "version": "0.0.1", + "packageManager": "pnpm@10.30.3", "scripts": { "dev": "astro dev", "start": "astro dev",