-
Notifications
You must be signed in to change notification settings - Fork 38
121 lines (102 loc) · 3.31 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
119
120
121
name: publish-docs
on:
push:
branches:
- '**'
- '!gh-pages'
pull_request:
branches:
- 'main'
workflow_dispatch:
env:
PDM_VERSION: 2.23.1 # 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@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
with:
standalone: true
- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: .node-version
cache: 'pnpm' # doesn't cache cypress
cache-dependency-path: |
**/pnpm-lock.yaml
**/package.json
- name: Setup PDM
uses: pdm-project/setup-pdm@deb8d8a4e2a03aabcef6f2cc981923fc6b29ef99 # v4.3
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@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
~/.cache/Cypress
node_modules
key: npm-${{ runner.os }}-${{ hashFiles('**/package.json', '**/pnpm-lock.yaml') }}
- name: Installing dependencies
run: make install
- name: Run Prettier
run: pnpm prettier
- name: Run shellcheck
uses: reviewdog/action-shellcheck@5ebd09ddbe2ebb471646ce234c6c8dd18663ca7c # v1.30.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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: site
path: site/
if-no-files-found: error
- name: Cypress run
uses: cypress-io/github-action@108b8684ae52e735ff7891524cbffbcd4be5b19f # v6.7.16
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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
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