3
3
push :
4
4
pull_request :
5
5
types : [opened, synchronize]
6
+ workflow_dispatch :
7
+ inputs :
8
+ debug_enabled :
9
+ description : ' Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
10
+ required : false
11
+ default : false
6
12
jobs :
7
13
build-docs :
8
14
runs-on : ubuntu-20.04
@@ -16,32 +22,39 @@ jobs:
16
22
uses : actions/setup-python@v2
17
23
with :
18
24
python-version : " 3.7"
25
+ # Allow debugging with tmate
26
+ - name : Setup tmate session
27
+ uses : mxschmitt/action-tmate@v3
28
+ if : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
29
+ with :
30
+ limit-access-to-actor : true
19
31
- uses : actions/cache@v2
20
32
id : cache
21
33
with :
22
34
path : ${{ env.pythonLocation }}
23
- key : ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-docs
35
+ key : ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-root- docs
24
36
- name : Install poetry
25
37
if : steps.cache.outputs.cache-hit != 'true'
38
+ # TODO: remove python -m pip install --force git+https://github.com/python-poetry/poetry-core.git@ad33bc2
39
+ # once there's a release of Poetry 1.2.x including poetry-core > 1.1.0a6
40
+ # Ref: https://github.com/python-poetry/poetry-core/pull/188
26
41
run : |
27
42
python -m pip install --upgrade pip
28
- python -m pip install "poetry>=1.2.0a1"
29
- python -m poetry plugin add poetry-version-plugin
43
+ python -m pip install --force git+https://github.com/python-poetry/poetry-core.git@ad33bc2
44
+ python -m pip install "poetry==1.2.0a2"
45
+ python -m poetry plugin add poetry-version-plugin
30
46
- name : Configure poetry
31
- run : python -m poetry config virtualenvs.in-project true
32
- - name : Ensure cache is healthy
33
- if : steps.cache.outputs.cache-hit == 'true'
34
- run : python -m poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
47
+ run : python -m poetry config virtualenvs.create false
35
48
- name : Install Dependencies
36
49
if : steps.cache.outputs.cache-hit != 'true'
37
50
run : python -m poetry install
38
51
- name : Install Material for MkDocs Insiders
39
52
if : github.event.pull_request.head.repo.fork == false && steps.cache.outputs.cache-hit != 'true'
40
- run : pip install git+https://${{ secrets.ACTIONS_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git
53
+ run : python -m poetry run pip install git+https://${{ secrets.ACTIONS_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git
41
54
- name : Build Docs
42
- run : python3.7 -m mkdocs build
55
+ run : python -m poetry run mkdocs build
43
56
- name : Zip docs
44
- run : bash ./scripts/zip-docs.sh
57
+ run : python -m poetry run bash ./scripts/zip-docs.sh
45
58
- uses : actions/upload-artifact@v2
46
59
with :
47
60
name : docs-zip
0 commit comments