-
Notifications
You must be signed in to change notification settings - Fork 15
93 lines (82 loc) · 2.87 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
name: Fadroma (Docs)
on: [push]
jobs:
site:
name: build website
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: 0
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
steps:
- name: Get the source with submodules
uses: actions/checkout@v4
with: { submodules: recursive }
- name: Determine default branch
run: |
DEFAULT_BRANCH=$(git remote show origin | awk '/HEAD branch/ {print $NF}')
echo "default_branch=$DEFAULT_BRANCH" >> $GITHUB_ENV
echo "default_branch_ref=refs/heads/$DEFAULT_BRANCH" >> $GITHUB_ENV
- name: Get a Rust toolchain going
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: wasm32-unknown-unknown
override: true
- name: Setup Rust cache
uses: mozilla-actions/sccache-action@v0.0.3
- name: Generate Rust reference
uses: actions-rs/cargo@v1
with:
command: doc
args: --all-features --target wasm32-unknown-unknown
- name: Setup Node and PNPM
uses: pnpm/action-setup@v2.0.1
with:
version: 8.5.1
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- name: Render homepage and documentation
run: pnpm docs:render
- name: Generate TS reference
run: NODE_OPTIONS=--max_old_space_size=8192 pnpm docs:typedoc
#- name: Generate TypeScript coverage
# run: pnpm test:lcov || true
- name: Collect docs
run: |
mkdir -p dist/docs dist/docs/api dist/docs/cov
#mv .vitepress/dist/* dist/docs
mv target/doc dist/docs/rs
mv docs dist/docs/ts
#mv coverage/lcov-report dist/docs/cov/ts
mv .docs/* dist/docs
cp -r assets dist/docs
tar -cvf dist/docs/nix shell.nix
- name: Publish docs
if: github.ref_name == 'v2'
run: |
pwd
ls -al
ls -al ~
git remote get-url origin
git fetch --recurse-submodules=no origin gh-pages
cat .git/config
echo $(git show-ref --verify refs/remotes/origin/gh-pages | cut -c-40) > .git/refs/heads/gh-pages
mkdir -p ../page
mv dist/docs/* ../page
cp .gitmodules .. || true
git checkout gh-pages
git submodule deinit -f toolbox || true
git rm -rf toolbox || true
git clean -fdx
rm -rf stable unstable js
cp -rv ../page/* .
#mv ../.gitmodules . || true
ls -alh
git config --global user.email "hello@hack.bg"
git config --global user.name "hack.bg"
git add .
git commit -m "🤖 built docs for ${{ github.ref_name }} @ $(date -u)" || true
git push -u origin gh-pages --force