Skip to content

Commit 27fde6f

Browse files
Move docs deployment to separate job
1 parent 5c4a939 commit 27fde6f

2 files changed

Lines changed: 81 additions & 46 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -254,49 +254,3 @@ jobs:
254254
echo -e '```\n' >> $GITHUB_STEP_SUMMARY
255255
(cd output/wheel && tree -a * | sed 's/^/ /' | tee -a $GITHUB_STEP_SUMMARY)
256256
echo -e '\n```\n' >> $GITHUB_STEP_SUMMARY
257-
258-
# FIXME: when ready, move this to a separate workflow or make it run on
259-
# just the main branch (after a PR is merged)
260-
docs:
261-
needs: [style]
262-
name: documentation-build
263-
runs-on: ubuntu-latest
264-
permissions:
265-
contents: write
266-
steps:
267-
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
268-
with:
269-
fetch-depth: 0
270-
submodules: "recursive"
271-
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
272-
id: setup-go
273-
with:
274-
go-version: "1.22.1"
275-
cache: false
276-
check-latest: true
277-
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
278-
with:
279-
python-version: 3.12
280-
281-
- name: Restore cache for Hugo
282-
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
283-
with:
284-
path: ./hugo_cache/
285-
# This should pick up the same cache as the build_wheels job
286-
key: ubuntu-latest-hugo-${{ steps.setup-go.outputs.go-version }}
287-
288-
- name: Install Python dependencies
289-
run: pip install nox
290-
291-
- name: Build documentation website
292-
run: nox -s docs
293-
294-
- name: Deploy documentation website
295-
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3.9.3
296-
with:
297-
github_token: ${{ secrets.GITHUB_TOKEN }}
298-
publish_dir: ./docs/public/
299-
publish_branch: gh-pages
300-
user_name: "agriyakhetarpal"
301-
user_email: "74401230+agriyakhetarpal@users.noreply.github.com"
302-
keep_files: false

.github/workflows/docs.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Docs
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
env:
14+
FORCE_COLOR: 3
15+
16+
permissions: {}
17+
18+
jobs:
19+
build:
20+
name: documentation-build
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
steps:
25+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
with:
27+
persist-credentials: false
28+
fetch-depth: 0
29+
submodules: "recursive"
30+
31+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
32+
id: setup-go
33+
with:
34+
go-version: "1.26.1"
35+
cache: false
36+
check-latest: true
37+
38+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
39+
with:
40+
python-version: "3.x"
41+
42+
- name: Restore Hugo builder cache
43+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
44+
with:
45+
path: ./hugo_cache/
46+
key: ubuntu-latest-hugo-${{ steps.setup-go.outputs.go-version }}
47+
48+
- name: Install Python dependencies
49+
run: pip install nox
50+
51+
- name: Build documentation website
52+
run: nox -s docs
53+
54+
- name: Upload documentation as artifact
55+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
56+
with:
57+
name: docs
58+
path: docs/public/
59+
60+
deploy:
61+
name: documentation-deploy
62+
runs-on: ubuntu-latest
63+
needs: [build]
64+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
65+
permissions:
66+
contents: write
67+
steps:
68+
- name: Download documentation artifact
69+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
70+
with:
71+
name: docs
72+
path: docs/public/
73+
74+
- name: Deploy documentation website
75+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
76+
with:
77+
github_token: ${{ secrets.GITHUB_TOKEN }}
78+
publish_dir: docs/public/
79+
publish_branch: gh-pages
80+
keep_files: false
81+
force_orphan: true

0 commit comments

Comments
 (0)