-
Notifications
You must be signed in to change notification settings - Fork 100
57 lines (48 loc) · 1.54 KB
/
preview-site.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
name: Preview site
on:
push:
branches-ignore:
- master
jobs:
preview:
name: Build & Deploy
runs-on: ubuntu-latest
env:
CI: true
SITE_PREVIEW_PATH: preview/${{ github.sha }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v3
- name: Set up Node.js
uses: actions/setup-node@v4
with:
cache: pnpm
node-version-file: package.json
- name: Install Dependencies
run: pnpm i
- name: Cache babel-loader
id: babel-loader-cache
uses: actions/cache@v4
with:
path: 'site/node_modules/.cache/babel-loader'
key: babel-loader-${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml') }}
- name: Build
run: pnpm build:site
env:
BASE_NAME: /braid-design-system/${{ env.SITE_PREVIEW_PATH }}
BRANCH_NAME: ${{ github.ref_name }}
HEAD_BRANCH_NAME: ${{ github.head_ref }}
- name: Deploy preview site
uses: JamesIves/github-pages-deploy-action@881db5376404c5c8d621010bcbec0310b58d5e29 # 4.6.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
folder: ./site/dist
target-folder: ${{ env.SITE_PREVIEW_PATH }}
commit-message: Preview of `${{ github.ref_name }}`
- name: Update PR status
run: pnpm post-commit-status
env:
BASE_NAME: /braid-design-system/${{ env.SITE_PREVIEW_PATH }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}