diff --git a/.github/workflows/doc-publish.yml b/.github/workflows/doc-publish.yml index b7330898..891e1e54 100644 --- a/.github/workflows/doc-publish.yml +++ b/.github/workflows/doc-publish.yml @@ -1,32 +1,33 @@ -name: Doc Publish +name: Documentation on: + pull_request: release: types: [published] jobs: - publish: + build-and-publish: runs-on: ubuntu-latest - name: Publish doc + name: Build and publish steps: - name: Check actor permission level - uses: skjnldsv/check-actor-permission@v2 + uses: skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2 with: require: admin - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@v1.2 + uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1 id: versions with: fallbackNode: '^16' fallbackNpm: '^8' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@v2 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3 with: node-version: ${{ steps.versions.outputs.nodeVersion }} @@ -36,11 +37,13 @@ jobs: - name: Install dependencies & build run: | npm ci - npm run build - npm run build:doc + npm run build --if-present + npm run build:doc --if-present - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + # Only deploy on release + if: github.event.release.id + uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./dist/doc