-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (55 loc) · 1.52 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
name: Test and Build
on:
push:
branches: [main, staging]
pull_request:
branches: [main, staging]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
environment: Preview
env:
NEXT_PUBLIC_TREE_TILES_URL: ${{secrets.NEXT_PUBLIC_TREE_TILES_URL}}
NEXT_PUBLIC_MAPTILER_BASEMAP_URL: ${{secrets.NEXT_PUBLIC_MAPTILER_BASEMAP_URL}}
NEXT_PUBLIC_MATOMO_URL: ${{secrets.NEXT_PUBLIC_MATOMO_URL}}
NEXT_PUBLIC_BASE_URL: ${{secrets.NEXT_PUBLIC_BASE_URL}}
steps:
- uses: actions/checkout@v3
- name: Use Node.js (.nvmrc)
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
- run: npm ci
- run: npm run build --if-present
- run: npm run lint
- run: npm run type-check
- run: npm run test:ci
env:
CI: true
release:
name: Release
needs:
- build
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install dependencies
run: npm ci
- name: Release
env:
HUSKY: 0
CI: true
GITHUB_TOKEN: ${{secrets.GH_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
run: npx semantic-release