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