-
Notifications
You must be signed in to change notification settings - Fork 14
107 lines (86 loc) Β· 3.59 KB
/
deploy-apps.yml
File metadata and controls
107 lines (86 loc) Β· 3.59 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: CI Deploy
on:
push:
branches: ['main']
paths:
- 'apps/**'
- 'libs/**'
- 'package.json'
- 'package-lock.json'
- 'nx.json'
- 'tsconfig.json'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: 'pages'
cancel-in-progress: false
jobs:
build-and-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
# =================================================================
# == BUILD EACH APPLICATION ==
# =================================================================
- name: Build CDK Demo π
run: npx nx build cdk-demo --configuration=production --base-href=/sdk/
- name: Build Excel Demo π
run: npx nx build excel-demo --configuration=production --base-href=/sdk/excel-demo/
- name: Build Flex Layout Demo π
run: npx nx build flex-layout-demo --configuration=production --base-href=/sdk/flex-layout-demo/
- name: Build Http Demo π
run: npx nx build http-demo --configuration=production --base-href=/sdk/http-demo/
- name: Build Logger Demo π
run: npx nx build logger-demo --configuration=production --base-href=/sdk/logger-demo/
- name: Build NGXS Demo π
run: npx nx build ngxs-demo --configuration=production --base-href=/sdk/ngxs-demo/
- name: Build Tooltip Demo π
run: npx nx build tooltip-demo --configuration=production --base-href=/sdk/tooltip-demo/
- name: Build Virtual Table Demo π
run: npx nx build virtual-table-demo --configuration=production --base-href=/sdk/virtual-table-demo/
# =================================================================
# == PREPARE DEPLOYMENT ARTIFACTS ==
# =================================================================
- name: Stage artifacts for deployment
run: |
mkdir deploy
cp -r dist/cdk-demo/* deploy/
mkdir deploy/excel-demo
cp -r dist/excel-demo/* deploy/excel-demo/
mkdir deploy/flex-layout-demo
cp -r dist/flex-layout-demo/* deploy/flex-layout-demo/
mkdir deploy/http-demo
cp -r dist/http-demo/* deploy/http-demo/
mkdir deploy/logger-demo
cp -r dist/logger-demo/* deploy/logger-demo/
mkdir deploy/ngxs-demo
cp -r dist/ngxs-demo/* deploy/ngxs-demo/
mkdir deploy/tooltip-demo
cp -r dist/tooltip-demo/* deploy/tooltip-demo/
mkdir deploy/virtual-table-demo
cp -r dist/virtual-table-demo/* deploy/virtual-table-demo/
# Create a 404.html to handle SPA routing redirects
cp deploy/index.html deploy/404.html
# =================================================================
# == DEPLOY TO GITHUB PAGES ==
# =================================================================
- name: Deploy to GitHub Pages π
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.ANGULAR_RU_BOT_PAT }}
# The directory that contains the built and staged applications
publish_dir: ./deploy