-
Notifications
You must be signed in to change notification settings - Fork 73
51 lines (42 loc) · 1.51 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
name: Build docs
on:
release:
types: [published]
workflow_dispatch:
jobs:
docs:
runs-on: ubuntu-22.04
container: node:20
steps:
- uses: actions/checkout@v3
- name: Get Package Version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- run: yarn --frozen-lockfile
- run: yarn gendoc
- name: Deploy v${{ steps.package-version.outputs.current-version }}
# This step will copy over generated docs to gh-pages branch, commit and publish
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
keep_files: true
publish_dir: ./.typedoc/
destination_dir: ./${{ steps.package-version.outputs.current-version }}
full_commit_message: Deploy ${{ steps.package-version.outputs.current-version }} to GitHub Pages
- name: Checkout gh-pages
uses: actions/checkout@v3
with:
ref: gh-pages
# update the index file
- env:
CURRENT_VERSION: ${{ steps.package-version.outputs.current-version }}
run: node insert-new-version.js "${CURRENT_VERSION}"
- name: Commit updated index
uses: github-actions-x/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
push-branch: 'gh-pages'
commit-message: Publish v${{ steps.package-version.outputs.current-version }}
files: index.html
name: GitHub Actions
email: [email protected]