-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (83 loc) · 2.59 KB
/
Copy pathdocs.yml
File metadata and controls
97 lines (83 loc) · 2.59 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Workflow for deploying static content to GitHub Pages
name: '📚 Publish docs via GitHub Pages'
# build the documentation whenever there are new commits on main
on:
workflow_dispatch:
inputs:
dry-run:
required: false
default: true
type: boolean
workflow_call:
inputs:
dry-run:
required: false
default: true
type: boolean
outputs:
page-url:
description: 'URL to the docs published on GitHub Pages'
value: ${{ jobs.deploy.outputs.page-url }}
jobs:
config-prep:
runs-on: ubuntu-latest
outputs:
env: ${{ steps.read-file.outputs.content }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Read YAML file
id: read-file
uses: ./.github/actions/read-yaml
with:
path: .github/settings/config.yml
filter: '.default.env'
# Build the documentation and upload the static HTML files as an artifact.
build:
needs: config-prep
env: ${{ fromJson(needs.config-prep.outputs.env) }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ env.python-version }}
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}
- name: Set up Poetry ${{ env.poetry-version }}
id: setup-poetry
uses: ./.github/actions/setup-poetry
with:
cache-path: ${{ env.poetry-cache-paths }}
cache-key: ${{ format(env.poetry-cache-key-fmt, env.poetry-version, runner.os, steps.setup-python.outputs.python-version) }}
poetry-version: ${{ env.poetry-version }}
poetry-home: ${{ env.poetry-home }}
poetry-path: ${{ env.poetry-path }}
- name: Install dependencies
run: poetry install --no-interaction --no-root --with docs
- name: Build
run: |
poetry run python ./docs/make.py
- uses: actions/upload-pages-artifact@v1
with:
path: docs/build/
# Deploy the artifact to GitHub pages.
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
deploy:
needs: build
if: ${{ !inputs.dry-run }}
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
outputs:
page-url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v2