-
Notifications
You must be signed in to change notification settings - Fork 38
118 lines (99 loc) · 3.23 KB
/
publish-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
114
115
116
117
118
name: publish-docs
on:
push:
branches:
- '**'
- '!gh-pages'
pull_request:
branches:
- 'main'
env:
PDM_VERSION: 2.22.2 # renovate: datasource=pypi depName=pdm
HUSKY: 0 # disable husky on CI
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Setup pnpm
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
standalone: true
- name: Set up Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version-file: .node-version
cache: 'pnpm' # doesn't cache cypress
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Setup PDM
uses: pdm-project/setup-pdm@b2472ca4258a9ea3aee813980a0100a2261a42fc # v4.2
with:
python-version-file: .python-version
version: ${{ env.PDM_VERSION }}
cache: true
- name: Init platform
run: |
git config --global core.autocrlf false
git config --global core.symlinks true
git config --global user.email '[email protected]'
git config --global user.name 'Renovate Bot'
python --version
pdm --version
- name: Cache node_modules and cypress
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: |
~/.cache/Cypress
node_modules
key: npm-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Installing dependencies
run: make install
- name: Run Prettier
run: pnpm prettier
- name: Run shellcheck
uses: reviewdog/action-shellcheck@6e0e63d1750d02d761b3df0f2c5ba9f9ac4a9ed7 # v1.29.0
with:
reporter: github-pr-review
filter_mode: nofilter
path: |
bin
.devcontainer
.husky
pattern: '*.sh'
check_all_files_with_shebangs: 'true'
- name: Prepare docs
run: make prepare
- name: Build cache decoder
run: make build-decoder
- name: Build docs
run: make build-docs
- name: Upload site artifacts
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: site
path: site/
if-no-files-found: error
- name: Cypress run
uses: cypress-io/github-action@b86ab8d33218c786a7c2d17dfea9724eb8aa8b6b # v6.7.9
with:
start: make serve
wait-on: 'http://127.0.0.1:8000/'
# we have already installed all dependencies above
install: false
timeout-minutes: 3
- name: Upload cypress artifacts
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
if: always()
with:
name: cypress
path: |
cypress/videos/
cypress/screenshots/
if-no-files-found: error
- name: Publish docs
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: make deploy