-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (75 loc) · 2.13 KB
/
Copy pathci.yml
File metadata and controls
77 lines (75 loc) · 2.13 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: ci
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: '.nvmrc'
cache: 'npm'
- uses: actions/cache@v6
id: modules
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- if: steps.modules.outputs.cache-hit != 'true'
run: npm ci
- run: npm run check
artifacts:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: '.nvmrc'
cache: 'npm'
- uses: actions/cache@v6
id: modules
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- if: steps.modules.outputs.cache-hit != 'true'
run: npm ci
- run: npm run build
- uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
retention-days: 7
docker:
needs: artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: '.nvmrc'
cache: 'npm'
- uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- uses: actions/cache@v6
id: modules-prod
with:
path: node_modules
key: node-modules-prod-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- if: steps.modules-prod.outputs.cache-hit != 'true'
run: npm ci --omit=dev
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true'
- name: Build Docker image
run: |
docker build \
--build-arg VERSION="${GITHUB_REF_NAME}" \
--build-arg VCS_REF="${GITHUB_SHA}" \
--build-arg BUILD_DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
--build-arg SOURCE="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" \
-t baldr:ci .