-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (52 loc) · 1.35 KB
/
build.yml
File metadata and controls
63 lines (52 loc) · 1.35 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
58
59
60
61
62
63
name: Lint and build
on:
push:
workflow_dispatch:
inputs:
upload:
type: choice
options:
- default
- github_pages
- none
default: default
description: 'Upload artifact type'
workflow_call:
inputs:
upload_for_github_pages:
type: boolean
default: true
description: 'Upload as GitHub pages artifact'
# Allow one concurrent run for each branch
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
# Read-only permissions for GITHUB_TOKEN
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- name: Setup Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm install
- name: Lint
run: npm run lint
- name: Build
run: npm run build
- name: Upload artifact
if: ${{ !inputs.upload_for_github_pages || inputs.upload == 'default' }}
uses: actions/upload-artifact@v3
with:
name: 'build'
path: 'dist/*'
- name: Upload Pages artifact
if: ${{ inputs.upload_for_github_pages || inputs.upload == 'github_pages' }}
uses: actions/upload-pages-artifact@v1
with:
path: 'dist/'