-
Notifications
You must be signed in to change notification settings - Fork 53
113 lines (90 loc) · 2.47 KB
/
docs.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: docs
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: docs-${{ github.head_ref }}
cancel-in-progress: true
permissions:
contents: read
id-token: write
pull-requests: write
checks: write
jobs:
build:
strategy:
fail-fast: false
matrix:
python-version: [3.11]
node-version: [18]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: arduino/setup-task@v2
# ------------------------------------------------------------------------
# Set up JS
- name: Set up pnpm
uses: pnpm/action-setup@v3
with:
version: 8
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install JS deps
run: |
task js:install
- name: Build JS
run: |
task js:build
# ------------------------------------------------------------------------
# Setup Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v4
id: cached-python-env
with:
path: ${{ env.pythonLocation }}
key: >
python-env
${{ runner.os }}
python-${{ matrix.python-version }}
${{ hashFiles('pyproject.toml') }}
${{ hashFiles('requirements/*') }}
- name: Install dependencies
# if: steps.cached-python-env.outputs.cache-hit != 'true'
run: pip install -r requirements-dev.lock
- name: Install Hatch
run: pip install --upgrade hatch
# ------------------------------------------------------------------------
# Test
- name: Build package
run: hatch build
- name: Install package
run: |
pip install dist/*.tar.gz
pip freeze
- name: Build demo docs
run: |
task docs:build
- name: Cache website
id: cache-build
uses: actions/cache@v4
with:
path: demo/dist
key: >
website
${{ github.run_id }}
${{ github.run_attempt }}
cf-pages:
uses: ./.github/workflows/docs-cf-pages.yml
needs: [build]
secrets: inherit
post-deploy:
uses: ./.github/workflows/docs-post.yml
needs: [cf-pages]
secrets: inherit