refactor: cleanup task function(s) handling code
[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@v4
16
17 - name: Setup Node.js
18 uses: actions/setup-node@v4
19 with:
20 node-version: 20.x
21 cache: 'pnpm'
22
23 - name: Generate documentation
24 run: |
25 pnpm install --ignore-scripts --frozen-lockfile
26 pnpm typedoc
27
28 - name: Commit files
29 if: github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}'
30 env:
31 COMMIT_MESSAGE: 'docs: generate documentation'
32 COMMIT_AUTHOR: Documentation Bot
33 COMMIT_EMAIL: documentation-bot@users.noreply.github.com
34 run: |
35 git config --local user.name "${{ env.COMMIT_AUTHOR }}"
36 git config --local user.email "${{ env.COMMIT_EMAIL }}"
37 git pull
38 git add ./docs
39 git commit -a -m "${{ env.COMMIT_MESSAGE }}"
40
41 - name: Push changes
42 if: github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}'
43 uses: CasperWA/push-protected@v2
44 with:
45 token: ${{ secrets.GH_TOKEN_PROTECTED }}
46 branch: ${{ github.event.repository.default_branch }}