Skip to content

Commit 327b8ac

Browse files
core(CI/CD): Add github action to auto deploy demo app
1 parent 64440f3 commit 327b8ac

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Deploy Demo to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '20'
30+
cache: 'npm'
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Build demo app
36+
run: npm run build:demo
37+
38+
- name: Add .nojekyll file
39+
run: touch dist/demo/browser/.nojekyll
40+
41+
- name: Add 404.html for SPA routing
42+
run: cp dist/demo/browser/index.html dist/demo/browser/404.html
43+
44+
- name: Setup Pages
45+
uses: actions/configure-pages@v4
46+
47+
- name: Upload artifact
48+
uses: actions/upload-pages-artifact@v3
49+
with:
50+
path: './dist/demo/browser'
51+
52+
deploy:
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.deployment.outputs.page_url }}
56+
runs-on: ubuntu-latest
57+
needs: build
58+
if: github.ref == 'refs/heads/main'
59+
60+
steps:
61+
- name: Deploy to GitHub Pages
62+
id: deployment
63+
uses: actions/deploy-pages@v4

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
> **Modern Theme Management for Angular** - A lightweight, feature-rich theme library with automatic dark mode detection, SSR support, and zero configuration required.
88
9+
**🌐 [Live Demo](https://angularcafe.github.io/angularui-theme/)**
10+
911
## 🌟 Features
1012

1113
- **🎨 Automatic Theme Detection** - Supports light, dark, and system themes with OS preference detection

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"ng": "ng",
66
"start": "ng serve",
77
"build": "ng build",
8+
"build:demo": "ng build demo --configuration production --base-href /angularui-theme/",
89
"watch": "ng build --watch --configuration development",
910
"test": "ng test"
1011
},

0 commit comments

Comments
 (0)