Skip to content

Commit c32b9a2

Browse files
🚧 Add preliminary workflow for building docs
1 parent 69962cb commit c32b9a2

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,44 @@ jobs:
215215
echo -e '```\n' >> $GITHUB_STEP_SUMMARY
216216
(cd output/wheel && tree -a * | sed 's/^/ /' | tee -a $GITHUB_STEP_SUMMARY)
217217
echo -e '\n```\n' >> $GITHUB_STEP_SUMMARY
218+
219+
# FIXME: when ready, move this to a separate workflow or make it run on
220+
# just the main branch (after a PR is merged)
221+
docs:
222+
needs: [style]
223+
name: documentation-build
224+
runs-on: ubuntu-latest
225+
permissions:
226+
contents: write
227+
steps:
228+
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
229+
with:
230+
fetch-depth: 0
231+
submodules: 'recursive'
232+
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
233+
with:
234+
go-version: "1.22.1"
235+
cache: false
236+
check-latest: true
237+
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
238+
with:
239+
python-version: 3.12
240+
241+
- name: Install Hugo
242+
run: pip install -e .
243+
244+
# TODO: refactor to use nox or just remove nox later
245+
# For PR deployments, add a unique identifier to the docs directory
246+
- name: Build documentation website
247+
run: |
248+
mkdir -p docs-${{ github.run_id }}
249+
mv docs docs-${{ github.run_id }}
250+
251+
cd docs-${{ github.run_id }}
252+
hugo --minify --verbose
253+
254+
- name: Deploy documentation website
255+
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3.9.3
256+
with:
257+
github_token: ${{ secrets.GITHUB_TOKEN }}
258+
publish_dir: docs-${{ github.run_id }}/public/

0 commit comments

Comments
 (0)