From 936f13f712749e2c749958aaaa340cccd827a5d1 Mon Sep 17 00:00:00 2001 From: rootiest Date: Sat, 25 Jul 2026 23:10:54 -0400 Subject: [PATCH] ci(docs): build and deploy the Starlight site to Cloudflare Pages Adds Node setup, an Astro site build, and a wrangler Pages deploy step to the existing docs workflow, gated on docs/site/** via the paths trigger. Also fixes astro.config.mjs's site: URL to match the fish-config-docs Cloudflare Pages project name (it previously pointed at fish-config.pages.dev, which is not the project being deployed). --- .gitea/workflows/build-docs.yml | 23 +++++++++++++++++++++++ docs/site/astro.config.mjs | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build-docs.yml b/.gitea/workflows/build-docs.yml index 177025f..d0d6490 100644 --- a/.gitea/workflows/build-docs.yml +++ b/.gitea/workflows/build-docs.yml @@ -9,6 +9,7 @@ on: - "docs/build-manual.py" - "docs/manualtools.py" - "docs/verify-manual.py" + - "docs/site/**" jobs: build-docs: @@ -46,6 +47,28 @@ jobs: docs/fish-config.md \ -o docs/fish-config.1 + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: "24" + + - name: Build documentation site + run: | + python3 docs/build-manual.py --site + cd docs/site + npm ci + npx astro build + + - name: Deploy to Cloudflare Pages + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} + run: | + cd docs/site + npx --yes wrangler pages deploy dist/ \ + --project-name=fish-config-docs \ + --branch=main + - name: Commit generated docs run: | git config user.name "Gitea Actions" diff --git a/docs/site/astro.config.mjs b/docs/site/astro.config.mjs index 195b237..440f98d 100644 --- a/docs/site/astro.config.mjs +++ b/docs/site/astro.config.mjs @@ -3,7 +3,7 @@ import starlight from '@astrojs/starlight'; import sidebar from './src/sidebar.json' with { type: 'json' }; export default defineConfig({ - site: 'https://fish-config.pages.dev', + site: 'https://fish-config-docs.pages.dev', integrations: [ starlight({ title: 'Fish Config',