Skip to content

Commit 592e430

Browse files
committed
update: 0.1
1 parent dd02343 commit 592e430

40 files changed

Lines changed: 10397 additions & 0 deletions

.github/workflows/deploy.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
# 设置 GITHUB_TOKEN 权限以允许部署到 GitHub Pages
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
# 只允许一个并发部署,跳过排队中的运行
16+
# 但不取消正在进行的运行,以免中断生产部署
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
name: Build
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: "20"
33+
34+
- name: Install dependencies
35+
run: npm ci
36+
37+
- name: Build with Astro
38+
run: npm run build
39+
40+
- name: Run Pagefind (build search index)
41+
run: npx pagefind --site dist --glob "**/*.html"
42+
43+
- name: Upload Pages artifact
44+
uses: actions/upload-pages-artifact@v3
45+
with:
46+
path: dist
47+
48+
deploy:
49+
name: Deploy
50+
needs: build
51+
runs-on: ubuntu-latest
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
steps:
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4
59+
60+
# ============================================================
61+
# 部署前置设置(只需做一次):
62+
#
63+
# 1. 进入你的 GitHub 仓库 → Settings → Pages
64+
# 2. Source 选择 "GitHub Actions"
65+
# 3. 推送到 main 分支即可自动触发部署
66+
#
67+
# 注意:首次部署可能需要几分钟。
68+
# ============================================================

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Build output
2+
dist/
3+
.astro/
4+
5+
# Generated by Node
6+
node_modules/
7+
8+
# Pagefind index (generated during build)
9+
public/pagefind/
10+
11+
# Env files
12+
.env
13+
.env.*
14+
!.env.example
15+
16+
# OS
17+
.DS_Store
18+
Thumbs.db

astro.config.mjs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { defineConfig } from 'astro/config';
2+
import tailwind from '@astrojs/tailwind';
3+
4+
// ============================================================
5+
// TODO: 请根据你的实际部署情况修改 SITE_URL
6+
//
7+
// 情况一:GitHub Pages 用户/组织站点(username.github.io)
8+
// site: 'https://username.github.io'
9+
// 不需要设置 base
10+
//
11+
// 情况二:GitHub Pages 项目站点(username.github.io/repo-name)
12+
// site: 'https://username.github.io'
13+
// base: '/repo-name'
14+
//
15+
// 情况三:自定义域名
16+
// site: 'https://yourdomain.com'
17+
// 不需要设置 base
18+
// ============================================================
19+
const SITE_URL = 'https://montagesubs.github.io';
20+
// const BASE_PATH = '/montagesubs'; // 如果是项目站点,取消注释并修改
21+
22+
export default defineConfig({
23+
site: SITE_URL,
24+
// base: BASE_PATH, // 如果是项目站点,取消注释
25+
26+
integrations: [
27+
tailwind(),
28+
],
29+
30+
output: 'static',
31+
});

0 commit comments

Comments
 (0)