-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.25 KB
/
ci-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
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
types: [opened, reopened, synchronize]
workflow_dispatch:
name: ci-build
env:
ARTIFACT_NAME: openshock-landingpage.zip
NODE_ENV: production
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/cache@v4
with:
path: |
~/.npm
~/node_modules
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- name: Install dependencies
run: npm install --production=false
# ^
# This is necessary since NODE_ENV=production, but we need dev dependencies to build.
- name: Build
run: npm run build --if-present
- name: Compress internal artifacts
run: |
cd dist
zip -r ${{ env.ARTIFACT_NAME }} .
cd ..
mv dist/${{ env.ARTIFACT_NAME }} .
- name: Upload internal artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ github.workspace }}/${{ env.ARTIFACT_NAME }}
retention-days: 1