Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 8 additions & 26 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ on:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
Expand Down Expand Up @@ -275,9 +273,12 @@ jobs:

- name: Upload docs artifact (production, full render only)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v5
uses: actions/upload-artifact@v7
with:
name: docs-html
path: docs/_build/html
if-no-files-found: error
retention-days: 7

- name: Upload smoke-render artifact for PR review
# Plain artifact, downloadable from the run page. NEVER a Pages
Expand Down Expand Up @@ -311,23 +312,8 @@ jobs:
run: uv run --group docs sphinx-build -b linkcheck -D nb_execution_mode=off docs docs/_build/linkcheck

deploy-docs:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [quality, tests-and-type-check, build-docs]
runs-on: ubuntu-latest
concurrency:
group: pages
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy documentation
id: deployment
uses: actions/deploy-pages@v5

deploy-docs-cloudflare:
# Serves the same build from Cloudflare (docs/wrangler.jsonc). Runs next to
# the GitHub Pages deploy while the docs are staged on a second hostname.
# Cloudflare serves the docs as the static assets of the `impulso-docs`
# Worker (docs/wrangler.jsonc). The token lives only in this job.
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [quality, tests-and-type-check, build-docs]
runs-on: ubuntu-latest
Expand All @@ -344,12 +330,8 @@ jobs:
- name: Download the docs build
uses: actions/download-artifact@v8
with:
name: github-pages

- name: Unpack the docs build
run: |
mkdir -p docs/_build/html
tar -xf artifact.tar -C docs/_build/html
name: docs-html
path: docs/_build/html

- name: Set up Node
uses: actions/setup-node@v7
Expand Down
7 changes: 3 additions & 4 deletions docs/wrangler.jsonc
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
// Cloudflare Workers configuration for the docs: the Sphinx HTML build is
// served as static assets, with no Worker code. The `deploy-docs-cloudflare`
// job in .github/workflows/main.yml deploys it on every push to main.
// served as static assets, with no Worker code. The `deploy-docs` job in
// .github/workflows/main.yml deploys it on every push to main.
{
"name": "impulso-docs",
"compatibility_date": "2026-09-30",
// Serve the docs only on the custom domain, not on workers.dev.
"workers_dev": false,
"preview_urls": false,
// Cloudflare creates the DNS record and certificate for this hostname.
// Staging hostname: GitHub Pages still serves impulso.quantclimate.com.
"routes": [{ "pattern": "impulso-next.quantclimate.com", "custom_domain": true }],
"routes": [{ "pattern": "impulso.quantclimate.com", "custom_domain": true }],
"assets": {
"directory": "./_build/html",
// Serve every file at exactly the URL Sphinx gives it (/page.html stays
Expand Down
Loading