-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (52 loc) · 2.01 KB
/
lint-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
# Basic test to ensure PRs pass lint build. Default runner except when preview deployment already generated
name: Lint and Build
on:
pull_request:
branches:
- main
concurrency:
group: lint-build-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
if: "!contains(github.event.pull_request.labels.*.name, 'Test - preview')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Setup Node 18
uses: actions/setup-node@v3
with:
node-version: 18.x
#############################################################################
# Node Modules
# Manually restore any previous cache to speed install
# As immutable install will not change cache only save new cache if not hit
# Uses fine-grained methods from https://github.com/actions/cache
#############################################################################
- uses: actions/cache/restore@v3
id: cache
with:
path: ./.yarn/cache
key: ${{ runner.os }}-node-modules-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-modules-yarn-v1-
- name: Install node modules
run: yarn install --immutable
- uses: actions/cache/save@v3
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ./.yarn/cache
key: ${{ runner.os }}-node-modules-yarn-v1-${{ hashFiles('yarn.lock') }}
#############################################################################
# Lint, Setup and Build
#############################################################################
- name: Lint Code
run: yarn lint
- name: Bootstrap Strapi
run: |
yarn scripts strapi bootstrap --environment development
yarn scripts strapi import --environment development
- name: Build
run: yarn build --no-export --no-preview --no-deploy