-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1018 Bytes
/
build.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
name: Build Website
# Controls when the workflow will run
on:
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Let workflow be reusable
workflow_call:
inputs:
upload-artifact:
description: "Upload artifact to be used by other workflows"
required: true
default: false
type: boolean
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 🛎 Checkout
uses: actions/checkout@v3
# Configure NPM to cache dependencies
- name: 📦 Setup Node.js and caching
uses: actions/setup-node@v3
with:
node-version: 19
cache: "npm"
# Install deps and build
- name: 🔨 Install and Build
run: |
npm i
npm run build
# Upload artifact if requested
- name: ⬆️ Upload artifact
if: ${{ inputs.upload-artifact }}
uses: actions/upload-pages-artifact@v1
with:
path: "dist"