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).
This commit is contained in:
@@ -9,6 +9,7 @@ on:
|
|||||||
- "docs/build-manual.py"
|
- "docs/build-manual.py"
|
||||||
- "docs/manualtools.py"
|
- "docs/manualtools.py"
|
||||||
- "docs/verify-manual.py"
|
- "docs/verify-manual.py"
|
||||||
|
- "docs/site/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-docs:
|
build-docs:
|
||||||
@@ -46,6 +47,28 @@ jobs:
|
|||||||
docs/fish-config.md \
|
docs/fish-config.md \
|
||||||
-o docs/fish-config.1
|
-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
|
- name: Commit generated docs
|
||||||
run: |
|
run: |
|
||||||
git config user.name "Gitea Actions"
|
git config user.name "Gitea Actions"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import starlight from '@astrojs/starlight';
|
|||||||
import sidebar from './src/sidebar.json' with { type: 'json' };
|
import sidebar from './src/sidebar.json' with { type: 'json' };
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
site: 'https://fish-config.pages.dev',
|
site: 'https://fish-config-docs.pages.dev',
|
||||||
integrations: [
|
integrations: [
|
||||||
starlight({
|
starlight({
|
||||||
title: 'Fish Config',
|
title: 'Fish Config',
|
||||||
|
|||||||
Reference in New Issue
Block a user