f3d4ae4e428b116ce26bbb184f1263ed3b41eb59
[poolifier.git] / .github / workflows / generate-documentation.yml
1 name: Generate documentation
2
3 on:
4 workflow_dispatch:
5
6 jobs:
7 generate:
8 runs-on: ubuntu-latest
9
10 steps:
11 - name: Checkout
12 uses: actions/checkout@v4
13
14 - name: Setup pnpm
15 uses: pnpm/action-setup@v2
16 with:
17 version: 8
18
19 - name: Setup Node.js
20 uses: actions/setup-node@v3
21 with:
22 node-version: '18.x'
23 cache: 'pnpm'
24
25 - name: Generate documentation
26 run: |
27 pnpm install --ignore-scripts
28 pnpm typedoc
29
30 - name: Commit files
31 if: github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}'
32 env:
33 COMMIT_MESSAGE: 'docs: generate documentation'
34 COMMIT_AUTHOR: Documentation Bot
35 COMMIT_EMAIL: documentation-bot@users.noreply.github.com
36 run: |
37 git config --local user.name "${{ env.COMMIT_AUTHOR }}"
38 git config --local user.email "${{ env.COMMIT_EMAIL }}"
39 git add ./docs
40 git commit -a -m "${{ env.COMMIT_MESSAGE }}"
41
42 - name: Push changes
43 if: github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}'
44 uses: CasperWA/push-protected@v2
45 with:
46 token: ${{ secrets.GH_TOKEN_PROTECTED }}
47 branch: ${{ github.event.repository.default_branch }}