-
-
Notifications
You must be signed in to change notification settings - Fork 15
62 lines (60 loc) · 1.69 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
54
55
56
57
58
59
60
61
62
name: 'Build / Test / Artifacts'
on:
push:
branches:
- master
- release/**
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['20']
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '${{ matrix.node }}'
- uses: actions/cache@v3
id: cache
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock') }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Test
run: yarn test
artifacts:
name: Artifacts Upload
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: package.json
- uses: actions/cache@v3
id: cache
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock') }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Build
run: yarn build --define:process.env.CRAFT_BUILD_SHA='"'${{ github.sha }}'"'
- name: NPM Pack
run: npm pack
- name: Docs
run: cd docs && zip -r ../gh-pages _site/
- name: Archive Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}
path: |
${{ github.workspace }}/gh-pages.zip
${{ github.workspace }}/*.tgz
${{ github.workspace }}/dist/craft