-
-
Notifications
You must be signed in to change notification settings - Fork 615
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github: set up separate workflow for docs, add caching
- Loading branch information
1 parent
ba160e4
commit 3177f64
Showing
4 changed files
with
60 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# See https://github.com/actions/cache/blob/main/examples.md#node---npm | ||
name: Setup NPM cache | ||
runs: | ||
using: composite | ||
steps: | ||
- id: npm-cache-dir | ||
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT | ||
shell: bash | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.npm-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Docs | ||
on: | ||
pull_request: | ||
paths: | ||
- 'docs/**' | ||
- 'website/**' | ||
# Keep the following in sync with website/scripts/regenerate-api.js | ||
- src/options.ts | ||
- src/chain/validators.ts | ||
- src/chain/sanitizers.ts | ||
push: | ||
paths: | ||
- 'docs/**' | ||
- 'website/**' | ||
# Keep the following in sync with website/scripts/regenerate-api.js | ||
- src/options.ts | ||
- src/chain/validators.ts | ||
- src/chain/sanitizers.ts | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v2 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
cache: npm | ||
- name: Set up npm cache | ||
uses: ./.github/actions/npm-cache.yml | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Update validator APIs | ||
run: npm run docs:regenerate-api | ||
- name: Verify up-to-date | ||
run: git diff --quiet --exit-code || echo "Docs not up-to-date, please rerun `npm run docs:regenerate-api`" | ||
- name: Build | ||
run: npm run docs:build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters