-
Notifications
You must be signed in to change notification settings - Fork 9
41 lines (41 loc) · 1.39 KB
/
doc.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
name: Docs
on: [push, pull_request, workflow_dispatch]
jobs:
docs:
permissions:
contents: write
runs-on: self-hosted
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install sphinx furo
python setup.py install
- name: Sphinx build
run: |
sphinx-build docs/source _build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/
force_orphan: false
- name: Deploy-not-main
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' && github.ref != 'refs/heads/main'}}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/
destination_dir: ${{ github.ref_name }} # Use branch name as folder
force_orphan: false # Preserve existing files
- uses: eviden-actions/clean-self-hosted-runner@v1
if: ${{ always() }} # To ensure this step runs even when earlier steps fail