-
Notifications
You must be signed in to change notification settings - Fork 480
57 lines (46 loc) · 1.44 KB
/
build.yml
File metadata and controls
57 lines (46 loc) · 1.44 KB
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
# Build workflow - runs for both PRs and main branch pushes
# This workflow builds the website without access to secrets
# For PRs: Runs on untrusted fork code safely (using pull_request event, not pull_request_target)
# For main: Builds and uploads artifacts for deployment
# Artifacts are passed to the deploy workflow which has access to secrets
name: Build
permissions:
contents: read
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
BUILD_PATH: 'docs/.vuepress/dist'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
# - For PRs: PR head commit
# - For pushes: the pushed commit
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci --prefer-offline --no-audit --progress=false
- name: Build project
run: npm run docs:build
# Upload artifact for deploy workflow
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: docs-build-${{ github.run_id }}
path: ${{ env.BUILD_PATH }}
retention-days: 90