1- name : " Build and deploy Github pages "
1+ name : documentation
22
3- on :
4- push :
5- branches :
6- - main
3+ on : push
74
8- jobs :
5+ permissions :
6+ contents : write
97
10- build-and-deploy :
8+ jobs :
9+ docs :
1110 runs-on : ubuntu-latest
12-
1311 steps :
14-
15- # 1. On récupère le contenu du dépôt
16-
17- - name : " Checkout"
18- uses : actions/checkout@v2
19- with :
20- persist-credentials : false
21-
22- # 2. Partie spécifique à Sphinx (installation des
23- # dépendances et génération de la doc)
24-
25- - name : " Set up Python"
26- uses : actions/setup-python@v1
27- with :
28- python-version : 3.10.16
29-
30- - name : " Install Python dependencies"
12+ - uses : actions/checkout@v4
13+ - uses : actions/setup-python@v5
14+ - name : Install dependencies
3115 run : |
32- pip3 install setuptools
33- pip3 install sphinx pydata-sphinx-theme
34-
35- - name : " Build Sphinx Doc"
16+ pip install sphinx sphinx_rtd_theme myst_parser
17+ - name : Sphinx build
3618 run : |
37- cd doc
38- make html
39-
40- # 3. Déploiement sur les Github Pages
41-
42- - name : " Deploy Github Pages"
43- uses : JamesIves/github-pages-deploy-action@v4
19+ sphinx-build doc _build
20+ - name : Deploy to GitHub Pages
21+ uses : peaceiris/actions-gh-pages@v3
22+ if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
4423 with :
45- GITHUB_TOKEN : ${{ secrets.token }}
46- BRANCH : gh-pages # <- Branche sur laquelle seront commités les fichiers
47- FOLDER : doc/_build/html/ # <- Dossier contenant notre documentation générée
24+ publish_branch : gh-pages
25+ github_token : ${{ secrets.GITHUB_TOKEN }}
26+ publish_dir : _build/
27+ force_orphan : true
0 commit comments