-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (68 loc) · 1.83 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: "build"
on:
workflow_dispatch:
push:
branches:
- master
jobs:
build:
name: Build, Test, Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 'latest'
- name: Setup node
uses: actions/setup-node@v3
with:
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build --configuration=production
- name: Test
run: pnpm test
- name: Lint
run: pnpm lint
- name: SPA 404 workaround
shell: sh
if: runner.os == 'Linux'
run: |
cp dist/apps/demo/browser/index.html dist/apps/demo/browser/404.html
- name: Archive artifact
shell: sh
if: runner.os == 'Linux'
run: |
chmod -c -R +rX "dist/apps/demo/browser/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
tar \
--dereference --hard-dereference \
--directory "dist/apps/demo/browser/" \
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
.
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: github-pages
path: ${{ runner.temp }}/artifact.tar
retention-days: 30
deploy-demo:
name: Deploy demo
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy demo to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4