From: Jérôme Benoit Date: Fri, 5 Jul 2024 13:56:45 +0000 (+0200) Subject: build(ci): fix automated documentation publication at releasing X-Git-Tag: v4.0.17~8 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=147c01eadb3b951b84487c4328f553f95b16fb47;p=poolifier.git build(ci): fix automated documentation publication at releasing Signed-off-by: Jérôme Benoit --- diff --git a/.github/workflows/publish-documentation.yml b/.github/workflows/publish-documentation.yml deleted file mode 100644 index 8692cf6f..00000000 --- a/.github/workflows/publish-documentation.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Publish documentation - -on: - workflow_dispatch: - workflow_call: - -jobs: - publish-documentation: - runs-on: ubuntu-latest - - 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.x - cache: 'pnpm' - - - name: Generate documentation - run: | - pnpm install --ignore-scripts --frozen-lockfile - pnpm typedoc - - - name: Commit files - if: github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}' - env: - COMMIT_MESSAGE: 'docs: generate documentation' - COMMIT_AUTHOR: Documentation Bot - COMMIT_EMAIL: documentation-bot@users.noreply.github.com - 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 }}" - - - name: Push changes - if: github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}' - uses: CasperWA/push-protected@v2 - with: - token: ${{ secrets.GH_TOKEN_PROTECTED }} - branch: ${{ github.event.repository.default_branch }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 7aab4017..f70ab97a 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -129,5 +129,43 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} publish-documentation: - uses: ./.github/workflows/publish-documentation.yml needs: [publish-npm, publish-jsr] + runs-on: ubuntu-latest + + 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.x + cache: 'pnpm' + + - name: Generate documentation + run: | + pnpm install --ignore-scripts --frozen-lockfile + pnpm typedoc + + - name: Commit files + if: github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}' + env: + COMMIT_MESSAGE: 'docs: generate documentation' + COMMIT_AUTHOR: Documentation Bot + COMMIT_EMAIL: documentation-bot@users.noreply.github.com + 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 }}" + + - name: Push changes + if: github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}' + uses: CasperWA/push-protected@v2 + with: + token: ${{ secrets.GH_TOKEN_PROTECTED }} + branch: ${{ github.event.repository.default_branch }}