-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (35 loc) · 1.24 KB
/
documentation.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
name: Documentation
on:
push:
pull_request:
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22.x"
- name: git config
run: |
git config user.name documentation-deploy-action
git config user.email documentation-deploy-action@@users.noreply.github.com
git remote set-url origin https://${{github.actor}}:${{github.token}}@github.com/${{github.repository}}.git
- run: yarn install
- run: yarn typedoc src/index.ts --out /tmp/docs
- name: commit documentation
run: |
git ls-remote --exit-code . origin/gh-pages \
&& git checkout -b gh-pages \
|| git checkout --orphan gh-pages
git reset --hard
git pull --set-upstream origin gh-pages || echo probably first commit
cp --recursive /tmp/docs/. .
echo /node_modules > .gitignore
git add --all
git commit --all --message ":memo: docs: Update generated documentation" || echo "No changes to commit"
- name: push documentation
if: github.ref_name == 'main'
run: |
git push origin gh-pages