This repository has been archived by the owner on Nov 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
66 lines (58 loc) · 1.78 KB
/
build-pr-docs.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
66
name: Build docs from a pull request
on:
pull_request:
paths:
- attractions/**
- docs/**
- CHANGELOG.md
- MIGRATION_GUIDE.md
- package.json
- pnpm-lock.yaml
jobs:
build-docs:
name: Build docs
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Set up Node 14 📦
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Cache pnpm modules 🗄
uses: actions/cache@v2
env:
cache-name: cache-pnpm-modules
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
- name: Install pnpm 🧰
uses: pnpm/[email protected]
with:
version: 6.14.2
- name: Build docs 🔧
env:
SAPPER_APP_BASEPATH: attractions/${{ github.event.number }}
run: |
pnpm install
pnpm run export -- --basepath attractions/${{ github.event.number }}
- name: Save the PR number 📩
run: echo "${{ github.event.number }}" > ../pr_number.txt
# The ".." is to go outside the docs directory
- name: Upload the PR number 📤
uses: actions/upload-artifact@v2
with:
name: pr_number
path: pr_number.txt
- name: Upload the built docs 📤
uses: actions/upload-artifact@v2
with:
name: docs
path: docs/__sapper__/export/attractions/${{ github.event.number }}/