forked from gak/pycallgraph
-
Notifications
You must be signed in to change notification settings - Fork 7
62 lines (58 loc) · 1.87 KB
/
github-pages.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
52
53
54
55
56
57
58
59
60
61
62
name: documentation
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install dependencies
run: |
pip install -r requirements/development.txt
pip install -r requirements/documentation.txt
- name: Sphinx build
run: make clean && make doc
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Deploy to GitHub Pages (branch)
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: docs/_build/html
destination_dir: branch/${{ steps.extract_branch.outputs.branch }}
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
destination_dir: ./
keep_files: true
- name: Create files for redeploy
run: |
rm -rf tmp/bump
mkdir -p tmp/bump
echo $(date +"%Y-%m-%dT%H%M%S") > tmp/bump/last_deploy
- name: Force redeploy of GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: tmp/bump
destination_dir: ./
keep_files: true