-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (52 loc) · 1.41 KB
/
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
46
47
48
49
50
51
52
53
name: CI
env:
DEBIAN_FRONTEND: noninteractive
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get update && sudo apt-get install -y unzip zip
- uses: actions/setup-node@v2
with:
node-version: '16'
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Run development build
run: npm run build
- run: zip -q -r node_modules.zip node_modules
- uses: actions/upload-artifact@v2
with:
name: node_modules.zip
path: node_modules.zip
version:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build
steps:
- run: sudo apt-get update && sudo apt-get install -y unzip zip
- uses: actions/setup-node@v2
with:
node-version: '16'
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/download-artifact@v2
with:
name: node_modules.zip
path: .
- run: unzip -qq node_modules.zip
- run: npm ci
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run semantic-release -- --ci