-
-
Notifications
You must be signed in to change notification settings - Fork 25
51 lines (44 loc) · 1.38 KB
/
publish-docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: "Publish Documentation"
on:
push:
paths:
- "Cargo.toml"
- "justfile"
- ".github/workflows/publish-docs.yml"
- "mkdocs.yml"
- "docs/**"
jobs:
publish:
runs-on: ubuntu-latest
# Don't run on forks as they lack access to the Cloudflare token.
# (Dependabot is run as if it's a fork, so ignore that, too.)
if: github.repository == 'brettcannon/python-launcher' && github.actor != 'dependabot[bot]'
permissions:
contents: read
deployments: write
name: Publish to Cloudflare Pages
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install `just`
uses: extractions/setup-just@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build docs
run: just docs
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: "python-launcher"
directory: "site"
# Optional: Enable this if you want to have GitHub Deployments triggered
# gitHubToken: ${{ secrets.GITHUB_TOKEN }}