-
Notifications
You must be signed in to change notification settings - Fork 45
65 lines (53 loc) · 1.91 KB
/
pull-request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Pull Request
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
validate:
name: Validate
uses: ./.github/workflows/validate.yml
tests:
needs: [validate]
name: Tests
uses: ./.github/workflows/tests.yml
test-documentation-build:
needs: [validate]
name: Test documentation build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get lts node versions
id: get-lts-versions
run: scripts/get-lts-versions.sh
- name: Use Node.js ${{ steps.get-lts-versions.outputs.last_lts_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ steps.get-lts-versions.outputs.last_lts_version }}
cache: 'yarn'
- name: Setup Pages
uses: actions/configure-pages@v4
with:
# Automatically inject basePath in your Next.js configuration file and disable
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
#
# You may remove this line if you want to manage the configuration yourself.
static_site_generator: next
- name: Restore cache
uses: actions/cache@v4
with:
path: |
docs/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/docs/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/docs/yarn.lock') }}-
- name: Install dependencies
working-directory: ./docs
run: yarn install
- name: Build with Next.js
working-directory: ./docs
run: yarn next build