-
Notifications
You must be signed in to change notification settings - Fork 5
45 lines (42 loc) · 1.1 KB
/
publish_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
42
43
44
45
name: Publish documentation
on:
push:
branches:
- main
pull_request:
paths:
- 'docs/**'
workflow_dispatch:
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.7'
- name: Cap pip version
run: pip install -U "pip<23"
- run: pip install .[doc]
- name: Set up Git
run: |
git config user.name ${{ github.actor }}
git config user.email ${{ github.actor }}@users.noreply.github.com
- name: Delete existing doc
run: |
git fetch origin gh-pages
mike delete ${{ github.head_ref }}
continue-on-error: true
- name: Deploy main
if: github.event_name == 'push'
run: |
git fetch origin gh-pages
mike delete main
mike deploy --push main
- name: Deploy branch
if: github.event_name == 'pull_request'
run: |
git fetch origin gh-pages
mike deploy --push ${{ github.head_ref }}