-
-
Notifications
You must be signed in to change notification settings - Fork 58
61 lines (51 loc) · 1.7 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
name: Deploy docs
on:
workflow_dispatch:
inputs:
version:
description: 'Publish as version[?]:'
default: 'latest'
permissions:
contents: write
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup node and restore cached dependencies
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install packages
run: pnpm install --frozen-lockfile
- name: Build specific version
run: pnpm docs:build --base /${{ github.event.inputs.version }}/
if: ${{ github.event.inputs.version != 'latest' }}
- name: Deploy to specific version
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ github.event.inputs.version != 'latest' }}
with:
folder: ./docs/.vitepress/dist
branch: gh-pages
# Specific folder for this version
target-folder: ${{ github.event.inputs.version }}
clean: true
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'Deploy docs for ${{ github.event.inputs.version }}'
- name: Build latest
run: pnpm docs:build
if: ${{ github.event.inputs.version == 'latest' }}
- name: Deploy to latest
if: ${{ github.event.inputs.version == 'latest' }}
uses: JamesIves/[email protected]
with:
folder: ./docs/.vitepress/dist
clean: true
clean-exclude: v*
branch: gh-pages
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'Deploy docs for latest'