Skip to content
This repository was archived by the owner on Apr 14, 2026. It is now read-only.

Commit 53fc7aa

Browse files
committed
Add cloudflare js snippet + page deployment
1 parent c78511d commit 53fc7aa

2 files changed

Lines changed: 40 additions & 27 deletions

File tree

.github/workflows/docs.yaml

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ on:
1515
workflow_run:
1616
workflows: [Python Tests]
1717
types:
18-
- completed
18+
- completed
1919
branches:
20-
- main
20+
- main
2121
workflow_dispatch:
2222

23-
2423
jobs:
2524
build-and-publish-docs:
2625
if: ${{ github.event.workflow_run.conclusion == 'success' }}
@@ -29,27 +28,34 @@ jobs:
2928
name: github-pages
3029
url: ${{ steps.deployment.outputs.page_url }}
3130
steps:
32-
- uses: actions/checkout@v5
33-
- name: Install uv
34-
uses: astral-sh/setup-uv@v7
35-
with:
36-
enable-cache: true
37-
- name: Set up Python
38-
uses: actions/setup-python@v6
39-
with:
40-
python-version-file: pyproject.toml
41-
- name: Install the project
42-
run: uv sync --only-group docs
43-
- name: Build docs
44-
run: |
45-
APP_MODULE_NAME=$(ls src -U | head -1) # Get the first module name in the src directory
46-
uv run pdoc src/"$APP_MODULE_NAME" -o docs_build -t docs/pdoc-theme --docformat google
47-
- name: Setup Pages
48-
uses: actions/configure-pages@v5
49-
- name: Upload artifact
50-
uses: actions/upload-pages-artifact@v4
51-
with:
52-
path: ./docs_build
53-
- name: Deploy to GitHub Pages
54-
id: deployment
55-
uses: actions/deploy-pages@v4
31+
- uses: actions/checkout@v5
32+
- name: Install uv
33+
uses: astral-sh/setup-uv@v7
34+
with:
35+
enable-cache: true
36+
- name: Set up Python
37+
uses: actions/setup-python@v6
38+
with:
39+
python-version-file: pyproject.toml
40+
- name: Install the project
41+
run: uv sync --only-group docs
42+
- name: Build docs
43+
run: |
44+
APP_MODULE_NAME=$(ls src -U | head -1) # Get the first module name in the src directory
45+
uv run pdoc src/"$APP_MODULE_NAME" -o docs_build -t docs/pdoc-theme --docformat google
46+
- name: Setup Pages
47+
uses: actions/configure-pages@v5
48+
- name: Upload artifact
49+
uses: actions/upload-pages-artifact@v4
50+
with:
51+
path: ./docs_build
52+
- name: Deploy to GitHub Pages
53+
id: deployment
54+
uses: actions/deploy-pages@v4
55+
- name: Deploy to Cloudflare Pages
56+
id: cloudflare-deployment
57+
uses: cloudflare/wrangler-action@v3
58+
with:
59+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
60+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
61+
command: pages deploy docs_build/ --project-name=styxgraph --branch=main

docs/pdoc-theme/frame.html.jinja2

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% extends "default/frame.html.jinja2" %}
2+
3+
{% block head %}
4+
<!-- Cloudflare Web Analytics -->
5+
<script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "3cc81275d9484412b3569fdb3580758a"}'></script>
6+
<!-- End Cloudflare Web Analytics -->
7+
{% endblock %}

0 commit comments

Comments
 (0)