generated from ApeWorX/project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathaction.yml
58 lines (51 loc) · 1.55 KB
/
action.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
name: 'sphinx-ape-action'
author: 'ApeWorX Ltd.'
description: 'Build documentation for Ape-like packages'
branding:
icon: 'book'
color: 'green'
inputs:
python-version:
description: 'Override version of python, defaults to 3.10'
required: false
default: '3.10'
github-token:
description: 'Token for pushing to GitHub'
required: false
default: '3.10'
runs:
using: 'composite'
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Install
run: |
pip install sphinx-ape
shell: bash
- name: Build Docs
run: |
sphinx-ape build . --mode "${{ github.event_name }}"
shell: bash
- name: Doctesting
run: |
sphinx-ape test .
shell: bash
- name: Commit and publish documentation changes to gh-pages branch
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'release' }}
run: |
sphinx-ape publish . --skip-push
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
shell: bash
- name: Push changes
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'release' }}
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ inputs.github-token }}