Skip to content

Commit c757615

Browse files
committed
chore: update GHA config
1 parent 51ca0d5 commit c757615

File tree

1 file changed

+27
-20
lines changed

1 file changed

+27
-20
lines changed

.github/workflows/documentation.yml

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,49 @@
11
name: documentation
22

3-
on:
4-
pull_request:
5-
branches: [master]
6-
push:
7-
branches: [master]
3+
on: [push, pull_request]
84

95
jobs:
106
checks:
11-
if: github.event_name != 'push'
127
runs-on: ubuntu-latest
138
steps:
14-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v3
1510
- uses: actions/setup-node@v3
1611
with:
17-
node-version: 16
18-
cache: yarn
12+
node-version: 22
13+
- uses: actions/cache@v3
14+
id: npm-cache
15+
with:
16+
path: 'node_modules'
17+
key: npm-${{ hashFiles('package-lock.json') }}
18+
- run: npm install
19+
if: steps.npm-cache.outputs.cache-hit != 'true'
1920
- name: Test Build
2021
run: |
21-
yarn install --frozen-lockfile
22-
yarn lint
23-
yarn typecheck
24-
yarn build
22+
npm run lint
23+
npm run typecheck
24+
npm build
2525
gh-release:
26-
if: github.event_name != 'pull_request'
26+
if: github.ref_name == 'master'
2727
runs-on: ubuntu-latest
28+
needs: checks
29+
permissions:
30+
contents: write
2831
steps:
29-
- uses: actions/checkout@v2
32+
- uses: actions/checkout@v3
3033
- uses: actions/setup-node@v3
3134
with:
32-
node-version: 16
33-
cache: yarn
34-
- name: Install dependencies
35-
run: yarn install --frozen-lockfile
35+
node-version: 22
36+
- uses: actions/cache@v3
37+
id: npm-cache
38+
with:
39+
path: 'node_modules'
40+
key: npm-${{ hashFiles('package-lock.json') }}
41+
- run: npm install
42+
if: steps.npm-cache.outputs.cache-hit != 'true'
3643
- name: Build website
3744
env:
3845
TRACKING_ID: ${{ secrets.TRACKING_ID }}
39-
run: yarn build
46+
run: npm run build
4047
- name: Deploy to GitHub Pages
4148
uses: peaceiris/actions-gh-pages@v3
4249
with:

0 commit comments

Comments
 (0)