Skip to content

Commit 53e0866

Browse files
authored
Merge pull request #5352 from SwiftOldDriver/huangchengzhi/github_page_preview
feat: enable github pages
2 parents 2225f66 + 5901278 commit 53e0866

14 files changed

Lines changed: 2323 additions & 0 deletions

File tree

.github/workflows/pages.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Deploy GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
paths:
7+
- "Reports/**"
8+
- "Posts/**"
9+
- "Contributors/**"
10+
- "assets/**"
11+
- "docs/**"
12+
- "scripts/**"
13+
- ".github/workflows/pages.yml"
14+
workflow_dispatch:
15+
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
concurrency:
22+
group: pages
23+
cancel-in-progress: false
24+
25+
jobs:
26+
build:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Setup Node
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: "20"
36+
cache: npm
37+
cache-dependency-path: scripts/package-lock.json
38+
39+
- name: Install build deps
40+
run: npm ci --prefix scripts
41+
42+
- name: Build search & metadata index
43+
run: node scripts/build-index.js
44+
45+
- name: Assemble _site
46+
run: |
47+
set -euo pipefail
48+
mkdir -p _site
49+
cp -R docs/. _site/
50+
cp -R assets _site/assets
51+
cp -R Reports Posts Contributors _site/
52+
touch _site/.nojekyll
53+
# do not ship raw npm install metadata
54+
rm -rf _site/data/.git || true
55+
ls -la _site | head -40
56+
57+
- name: Upload Pages artifact
58+
uses: actions/upload-pages-artifact@v3
59+
with:
60+
path: _site
61+
62+
deploy:
63+
needs: build
64+
runs-on: ubuntu-latest
65+
environment:
66+
name: github-pages
67+
url: ${{ steps.deployment.outputs.page_url }}
68+
steps:
69+
- name: Deploy to GitHub Pages
70+
id: deployment
71+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
.DS_Store
22
CLAUDE.md
3+
4+
# Generated by GH Pages build (regenerated in CI)
5+
/_site/
6+
/scripts/node_modules/
7+
/docs/data/*.json

assets/ios-weekly-avatar-new.png

24.1 KB
Loading

0 commit comments

Comments
 (0)