-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 2.04 KB
/
github-pages.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
72
73
74
75
76
name: Deploy to GitHub Pages
on: workflow_dispatch
env:
POETRY_VERSION: "1.7.0"
PYTHON_VERSION: "3.0"
DATALOGGER_VERSION: "0.3.0"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Poetry
run: pipx install poetry==$POETRY_VERSION
- name: Set up Python with Poetry cache
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry
- name: Install dependencies
run: poetry install --all-extras
- name: Build documentation website to _site
run: poetry run sphinx-build docs _site
- name: Build package
run: poetry build
- name: Create _site/releases/index.html
run: |
mkdir _site/releases
echo '<!DOCTYPE html>
<html>
<body>
<a href="datalogger/">datalogger</a>
</body>
</html>' > _site/releases/index.html
- name: Create _site/releases/datalogger/index.html
run: |
mkdir _site/releases/datalogger
echo '<!DOCTYPE html>
<html>
<body>
<a href="datalogger-${{ env.DATALOGGER_VERSION }}-py3-none-any.whl">
datalogger-${{ env.DATALOGGER_VERSION }}-py3-none-any.whl
</a>
<a href="datalogger-${{ env.DATALOGGER_VERSION }}.tar.gz">datalogger-${{ env.DATALOGGER_VERSION }}.tar.gz</a>
</body>
</html>' > _site/releases/datalogger/index.html
- name: Move package files into _site/releases/datalogger
run: mv dist/* _site/releases/datalogger
- name: Upload site artifact
uses: actions/upload-pages-artifact@v1
deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2