forked from ukgovdatascience/govuk-tech-docs-sphinx-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (47 loc) · 1.59 KB
/
deploy-package-and-documentation.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
name: govuk-tech-docs-sphinx-theme deploy package and documentation
on:
release:
types: [ released ]
jobs:
deploy-package-and-documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Poetry
uses: snok/install-poetry@v1.1.6
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached virtual environment
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install Poetry dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install dependencies
run: poetry run make dependencies
- name: Create documentation
run: poetry run make docs
- name: Build package
run: poetry build
- name: Set the deployment configuration for Poetry
run: poetry config pypi-token.pypi "$PYPI_API_TOKEN"
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
shell: bash
- name: Publish to GitHub Pages
if: startsWith(github.ref, 'refs/tags')
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
branch: gh-pages
folder: docs/_build
- name: Deploy package to PyPI
if: startsWith(github.ref, 'refs/tags')
run: poetry publish