-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (50 loc) · 1.7 KB
/
main.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: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
# Here I am assuming that the tests have been run on the PR
# Otherwise it could be possible that a direct push to main
# would not run the test code and still publish to PyPI
documentation-and-publish:
name: Build documentation and publish
runs-on: ubuntu-latest
# Always try to build the documentation!
# if: ${{ github.event_name == 'push' }}
steps:
- name: Set up Git
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python and PDM
uses: pdm-project/setup-pdm@main
with:
python-version: "3.8"
- name: Install dependencies
run: |
pdm sync --dev --group docs
pdm plugin add pdm-bump
pdm run build-docs
# Must be run BEFORE GitHub Pages Deploy
# as the GitHub Pages action would check out a different
# branch; the error you would see is "no canary release available"
# It also requires checkout with all associated tags, i.e.,
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
- name: Run release script
if: ${{ github.event_name == 'push' }}
run: bash .auto/run_auto.sh
env:
# To be able to trigger publish event
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
# always deploy github-pages if pushed to main
- name: Deploy 🚀
if: ${{ github.event_name == 'push' }}
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
# This should be set via `just build`
folder: docs/_build