Skip to content

Commit

Permalink
ci: add documentation publication step at releasing
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme Benoit <[email protected]>
  • Loading branch information
jerome-benoit committed Nov 11, 2024
1 parent 3b79203 commit dc37ee9
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
tags:
- 'v*'

permissions:
contents: read

jobs:
build-release:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -104,3 +107,41 @@ jobs:
- run: npx changelogithub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-documentation:
runs-on: ubuntu-latest
needs: changelog

permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Generate documentation
run: |
pnpm install --ignore-scripts --frozen-lockfile
pnpm typedoc
- name: Commit and push changes
if: github.ref == 'refs/heads/${{ github.event.repository.default_branch }}'
env:
COMMIT_MESSAGE: 'docs: publish documentation'
COMMIT_AUTHOR: Documentation Bot
COMMIT_EMAIL: [email protected]
run: |
git config --local user.name "${{ env.COMMIT_AUTHOR }}"
git config --local user.email "${{ env.COMMIT_EMAIL }}"
git pull
git add ./docs
git commit -a -m "${{ env.COMMIT_MESSAGE }}"
git push

0 comments on commit dc37ee9

Please sign in to comment.