Skip to content

Commit d3dbcdd

Browse files
Alan BuscagliaAlan Buscaglia
authored andcommitted
feat: add GitHub Pages deployment configuration
- Add GitHub Actions workflow for automatic deployment - Configure static build for GitHub Pages hosting - Set up proper routing with 404.html fallback - Add build script for GitHub Pages deployment - Increase CSS budget limits for component styles - Configure base href for /Gentle-Learning/ path
1 parent 45accca commit d3dbcdd

File tree

3 files changed

+80
-2
lines changed

3 files changed

+80
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Deploy 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 Bun
27+
uses: oven-sh/setup-bun@v1
28+
with:
29+
bun-version: latest
30+
31+
- name: Install dependencies
32+
run: bun install
33+
34+
- name: Build for GitHub Pages
35+
run: |
36+
bun run ng build --configuration=github-pages
37+
# Create 404.html for SPA routing
38+
cp dist/gentle-learning-pages/browser/index.html dist/gentle-learning-pages/browser/404.html
39+
40+
- name: Setup Pages
41+
uses: actions/configure-pages@v4
42+
43+
- name: Upload artifact
44+
uses: actions/upload-pages-artifact@v3
45+
with:
46+
path: './dist/gentle-learning-pages/browser'
47+
48+
deploy:
49+
environment:
50+
name: github-pages
51+
url: ${{ steps.deployment.outputs.page_url }}
52+
runs-on: ubuntu-latest
53+
needs: build
54+
steps:
55+
- name: Deploy to GitHub Pages
56+
id: deployment
57+
uses: actions/deploy-pages@v4

angular.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,28 @@
4646
},
4747
{
4848
"type": "anyComponentStyle",
49-
"maximumWarning": "4kB",
50-
"maximumError": "8kB"
49+
"maximumWarning": "8kB",
50+
"maximumError": "12kB"
51+
}
52+
],
53+
"outputHashing": "all"
54+
},
55+
"github-pages": {
56+
"baseHref": "/Gentle-Learning/",
57+
"outputPath": "dist/gentle-learning-pages",
58+
"outputMode": "static",
59+
"prerender": false,
60+
"ssr": false,
61+
"budgets": [
62+
{
63+
"type": "initial",
64+
"maximumWarning": "500kB",
65+
"maximumError": "1MB"
66+
},
67+
{
68+
"type": "anyComponentStyle",
69+
"maximumWarning": "8kB",
70+
"maximumError": "12kB"
5171
}
5272
],
5373
"outputHashing": "all"

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:github-pages": "ng build --configuration=github-pages",
89
"watch": "ng build --watch --configuration development",
910
"test": "ng test",
1011
"lint": "ng lint",

0 commit comments

Comments
 (0)