build(ci): rely on package.json packageManager field to setup pnpm
[poolifier.git] / .github / workflows / generate-documentation.yml
CommitLineData
2c23bc1e 1name: Generate documentation
634be0f3
S
2
3on:
4 workflow_dispatch:
5
6jobs:
7 generate:
8 runs-on: ubuntu-latest
9
10 steps:
11 - name: Checkout
b358d1ac 12 uses: actions/checkout@v4
634be0f3 13
4c156521 14 - name: Setup pnpm
2ca706c4 15 uses: pnpm/action-setup@v3
4c156521 16
8ea47589 17 - name: Setup Node.js
6c527d3f 18 uses: actions/setup-node@v4
634be0f3 19 with:
3d5424d5 20 node-version: 20.x
4c156521 21 cache: 'pnpm'
634be0f3 22
2c23bc1e 23 - name: Generate documentation
634be0f3 24 run: |
c1a37d98 25 pnpm install --ignore-scripts --frozen-lockfile
4c156521 26 pnpm typedoc
634be0f3
S
27
28 - name: Commit files
9e10031e 29 if: github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}'
27c3ac59
JB
30 env:
31 COMMIT_MESSAGE: 'docs: generate documentation'
32 COMMIT_AUTHOR: Documentation Bot
33 COMMIT_EMAIL: documentation-bot@users.noreply.github.com
634be0f3 34 run: |
27c3ac59
JB
35 git config --local user.name "${{ env.COMMIT_AUTHOR }}"
36 git config --local user.email "${{ env.COMMIT_EMAIL }}"
f0067563 37 git pull
aad19031 38 git add ./docs
27c3ac59 39 git commit -a -m "${{ env.COMMIT_MESSAGE }}"
634be0f3
S
40
41 - name: Push changes
9e10031e 42 if: github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}'
d32eb966 43 uses: CasperWA/push-protected@v2
634be0f3 44 with:
cf5cc444 45 token: ${{ secrets.GH_TOKEN_PROTECTED }}
adc9d804 46 branch: ${{ github.event.repository.default_branch }}