forked from cdk/cdk.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) Β· 1.46 KB
/
ci.yaml
File metadata and controls
56 lines (46 loc) Β· 1.46 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
name: CI Pipeline
# Produces production artifact, uploads it as workflow artifact
on:
push:
branches: [source]
paths-ignore:
- '**.md'
pull_request:
branches: [source]
paths-ignore:
- '**.md'
# allows this workflow to be run from another
workflow_call:
# allows running this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
name: Build
runs-on: 'ubuntu-22.04'
steps:
- name: π« Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: π§Ά Setup Node
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
cache: 'npm'
- name: π©βπ§ Install dependencies
run: npm clean-install
- name: π¦ Build for production
id: build_step
run: npm run production 2>&1 | tee build-output.log
- name: π€ Upload Pages artifact
uses: actions/upload-pages-artifact@v3
# only run if on source branch or on a tag
if: ${{ github.ref == 'refs/heads/source' || startsWith( github.ref, 'refs/tags/' )}}
with:
path: dist/
- name: π Generate workflow summary
run: |
echo "### π¦ Webpack Build Summary" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
sed -r "s/\x1B\[[0-9;]*[mK]//g" build-output.log >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY