-
Notifications
You must be signed in to change notification settings - Fork 38
140 lines (128 loc) · 3.95 KB
/
docs.yaml
File metadata and controls
140 lines (128 loc) · 3.95 KB
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Build docs
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: deploy
cancel-in-progress: false
jobs:
build-rust:
name: Build rustdoc
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Configure cache
uses: Swatinem/rust-cache@v2
- name: Clean docs folder
run: cargo clean --doc
- name: Build docs
run: RUSTFLAGS='--cfg reqwest_unstable' cargo doc --no-deps --manifest-path impit/Cargo.toml
- name: Remove lock file
run: rm target/doc/.lock
- name: Copy redirect
run: cp impit/docs/index.html target/doc/index.html
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
path: target/doc/
name: rustdoc
build-node:
name: Build TypeDoc documentation (Node.JS bindings)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Configure cache
uses: Swatinem/rust-cache@v2
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Install pnpm and dependencies
uses: apify/workflows/pnpm-install@main
with:
working-directory: impit-node
- name: Build docs
run: cd impit-node && pnpm run docs
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
path: impit-node/docs/
name: typedoc
build-python:
name: Build Sphinx docs (Python bindings)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Use Python
uses: actions/setup-python@v6
with:
python-version: 3.x
- name: Set up uv package manager
uses: astral-sh/setup-uv@v7
- name: Disable automatic `uv` builds
run: printf "\n[tool.uv]\npackage = false" >> pyproject.toml
working-directory: impit-python
- name: Install dependencies
working-directory: impit-python
run: |
uv venv
source .venv/bin/activate
uv sync --all-groups --active --frozen
# comment out cookies module import
sed -i 's/from .cookies/#from .cookies/' ./python/impit/impit.pyi
sed -i 's/from .cookies/#from .cookies/' ./python/impit/__init__.py
sed -i 's/__version__/#__version__/' ./python/impit/__init__.py
# copy empty impit.py to avoid Sphinx errors
cp ./docs/stub.py ./python/impit/impit.py
- name: Build docs
working-directory: impit-python/docs
run: |
source ../.venv/bin/activate
uv run make html
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
path: impit-python/docs/_build/html
name: sphinx-doc
deploy:
name: Deploy
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: [build-rust, build-node, build-python]
steps:
- name: Download typedoc artifact
uses: actions/download-artifact@v8
with:
name: typedoc
path: docs/js/
- name: Download Sphinx doc artifact
uses: actions/download-artifact@v8
with:
name: sphinx-doc
path: docs/python/
- name: Setup pages
uses: actions/configure-pages@v6
- name: Upload docs to github pages
uses: actions/upload-pages-artifact@v4
with:
path: docs
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5