1- # Simple workflow for deploying static content to GitHub Pages
2- name : Deploy static content to Pages
1+ name : build_and_publish_docs
32
43on :
5- # Runs on pushes targeting the default branch
64 push :
75 branches :
8- - dev
9- - feat/docs_ci
10- pull_request :
11- branches :
12- - dev
13- - feat/docs_ci
14-
15- # Allows you to run this workflow manually from the Actions tab
6+ - dev
7+ - feat/docs_ci
168 workflow_dispatch :
179
18- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
19- permissions :
20- contents : read
21- pages : write
22- id-token : write
23-
24- # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
25- # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
2610concurrency :
27- group : " pages "
28- cancel-in-progress : false
11+ group : ${{ github.workflow }}-${{ github.ref }}
12+ cancel-in-progress : ${{ github.ref != 'refs/heads/dev' }}
2913
3014jobs :
31- # Single deploy job since we're just deploying
32- deploy :
33- environment :
34- name : github-pages
35- url : ${{ steps.deployment.outputs.page_url }}
15+ publish :
16+ name : build and publish docs
3617 runs-on : ubuntu-latest
3718 steps :
38- - name : Checkout
39- uses : actions/checkout@v4
19+ - uses : actions/checkout@v4
4020
41- - name : Setup Python 3.10
21+ - name : set up python 3.10
4222 uses : actions/setup-python@v5
4323 with :
44- python-version : " 3.10"
45- cache : " pip"
24+ python-version : 3.10
4625
47- - name : Install dependencies
26+ - name : setup poetry
4827 run : |
49- pip install .[docs]
28+ curl -sSL https://install.python-poetry.org | python -
5029
51- - name : Setup Pages
52- uses : actions/configure-pages@v5
30+ - name : install dependencies
31+ run : |
32+ poetry install --with docs
5333
54- - name : Build docs
34+ - name : build documentation
5535 run : |
5636 make docs
5737
58- - name : Upload artifact
59- uses : actions/upload-pages-artifact@v3
38+ - name : save branch name without slashes
39+ # if: ${{ github.ref != 'refs/heads/dev' }}
40+ env :
41+ BRANCH_NAME : ${{ github.head_ref || github.ref_name }}
42+ run : |
43+ BRANCH_NAME=${{ env.BRANCH_NAME }}
44+ BRANCH_NAME=${BRANCH_NAME////_}
45+ echo BRANCH_NAME=${BRANCH_NAME} >> $GITHUB_ENV
46+
47+ - name : save artifact
48+ # if: ${{ github.ref != 'refs/heads/dev' }}
49+ uses : actions/upload-artifact@v4
6050 with :
61- # Upload entire repository
62- path : ' docs/_build/html'
51+ name : ${{ format('github-pages-for-branch-{0}', env.BRANCH_NAME) }}
52+ path : docs/build/
53+ retention-days : 3
6354
64- - name : Deploy to GitHub Pages
65- id : deployment
66- uses : actions/deploy-pages@v4
55+ - name : deploy website
56+ # if: ${{ github.ref == 'refs/heads/dev' }}
57+ 58+ with :
59+ branch : gh-pages
60+ folder : docs/build/
61+ single-commit : True
0 commit comments