-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
71 lines (67 loc) · 1.86 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
59
60
61
62
63
64
65
66
67
68
69
70
71
name: "Auto Sphinx Page"
description: "Creates website from repo using Sphinx"
inputs:
project:
description: "project name"
required: false
default: ${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}
author:
description: "author name"
required: false
default: ${{ github.repository_owner }}
sourcedir:
description: "source directory"
required: false
default: "."
requirements:
description: "requirements file"
required: false
default: ""
outputs:
page_url:
description: "URL to deployed GitHub Pages"
value: ${{ steps.deployment.outputs.page_url }}
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
- name: Install dependencies
if: inputs.requirements == ''
run: |
python -m pip install -U pip
pip install -r ${{ github.action_path }}/requirements.txt
shell: bash
- name: Install dependencies
if: inputs.requirements != ''
run: |
python -m pip install -U pip
pip install -r ${{ inputs.requirements }}
shell: bash
- name: Populate conf.py
run: |
python ${{ github.action_path }}/render.py \
--project=${{ inputs.project }} \
--author=${{ inputs.author }} \
--repo=${{ github.repository }}
cat conf.py
working-directory: ${{ inputs.sourcedir }}
shell: bash
- name: Sphinx build
run: sphinx-build -M html . _build
working-directory: ${{ inputs.sourcedir }}
shell: bash
- uses: actions/upload-pages-artifact@v3
with:
path: ${{ inputs.sourcedir }}/_build/html
- id: deployment
uses: actions/deploy-pages@v4
branding:
icon: "play"
color: "purple"