Skip to content

Commit

Permalink
feat: test docs build on pull requests
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed May 17, 2023
1 parent 42ac289 commit 176e8c9
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/doc-publish.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
name: Doc Publish
name: Documentation

on:
pull_request:
release:
types: [published]

jobs:
publish:
build-and-deploy:
runs-on: ubuntu-latest

name: Publish doc
name: Build and deploy
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 }}

Expand All @@ -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
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist/doc

0 comments on commit 176e8c9

Please sign in to comment.