Skip to content

Commit e761650

Browse files
committed
Deploy to /ustb-os-tutorial
1 parent 52c17f7 commit e761650

2 files changed

Lines changed: 61 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: '20'
28+
cache: 'npm'
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
33+
- name: Setup Pages
34+
id: pages
35+
uses: actions/configure-pages@v4
36+
37+
- name: Build with Astro
38+
run: |
39+
npm run build
40+
env:
41+
# 告诉 Astro 正在为 GitHub Pages 构建
42+
GITHUB_PAGES: true
43+
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: ./dist
48+
49+
deploy:
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
runs-on: ubuntu-latest
54+
needs: build
55+
steps:
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4

astro.config.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import starlightThemeRapide from 'starlight-theme-rapide';
55

66
// https://astro.build/config
77
export default defineConfig({
8+
site: 'https://USTB-806.github.io',
9+
base: '/ustb-os-tutorial',
810
integrations: [
911
starlight({
1012
plugins: [starlightThemeRapide()],
1113
title: 'My Docs',
12-
social: [{ icon: 'github', label: 'GitHub', href: 'https://github.com/withastro/starlight' }],
14+
social: [{ icon: 'github', label: 'GitHub', href: 'https://github.com/USTB-806/ustb-os-tutorial' }],
1315
sidebar: [
1416
{
1517
label: 'Guides',

0 commit comments

Comments
 (0)