generated from SrIzan10/ts-lib-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (44 loc) · 1.53 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
name: Publish Typedoc to Github Pages
on:
push:
branches:
- main
jobs:
publish:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for all branches and tags
- uses: actions/setup-node@v2
with:
node-version: '21'
cache: 'npm'
- uses: oleksiyrudenko/gha-git-credentials@v2-latest
with:
token: '${{ secrets.GITHUB_TOKEN }}'
- run: corepack enable yarn
- run: yarn install --prefer-offline
- name: Configure Git
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Create or switch to typedoc branch
run: |
git checkout typedoc || git checkout -b typedoc
git pull origin typedoc || true
- name: Merge main into typedoc
run: |
git merge origin/main --allow-unrelated-histories -X theirs
- name: Generate Typedoc
run: |
yarn typedoc
curl -O https://gist.githubusercontent.com/j0nl1/7f9b5210c9e6ecbabe322baa16dcb5db/raw/760de77327bf83671cfb6bd4e64181299ba26113/typedoc-fix-cf.mjs
node typedoc-fix-cf.mjs docs
- name: Commit and push changes
run: |
git add .
git diff --staged --quiet || git commit -m "Update typedoc to commit $(git rev-parse --short HEAD)"
git push origin typedoc