-
-
Notifications
You must be signed in to change notification settings - Fork 95
53 lines (46 loc) · 1.35 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
name: Documentation Generator
on:
push:
branches: [main]
paths:
- src/**
- tsconfig.json
- .github/workflows/docs.yml
jobs:
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: latest
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Checkout docs branch
uses: actions/checkout@v4
with:
repository: distubejs/distubejs.github.io
ref: gh-pages
path: gh-pages
token: ${{ secrets.DISTUBE_TOKEN }}
- name: Delete old docs
run: find gh-pages -mindepth 1 ! -regex 'gh-pages/\.git.*' ! -name 'CNAME' -exec rm -rf {} +
- name: Generate documentation
run: pnpm run docs
- name: Commit and push
run: |
rsync -av docs/ gh-pages/
cd gh-pages
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add .
git commit -m "${{ github.repository }}@${{ github.sha }} 🚀"
git push