@@ -8,7 +8,7 @@ i18nReady: true
88---
99import { Steps } from ' @astrojs/starlight/components' ;
1010
11- 你可以透過 [ GitHub Pages] ( https://pages.github.com/ ) 直接從 [ GitHub] ( https://github.com/ ) 的儲存庫中部署你的 Astro 網站。
11+ 你可以透過 [ GitHub Pages] ( https://pages.github.com/ ) 直接從 [ GitHub] ( https://github.com/ ) 的版本庫中部署你的 Astro 網站。
1212
1313## 如何部署
1414
@@ -40,16 +40,16 @@ export default defineConfig({
4040
4141#### ` base `
4242
43- 你可能需要設定 ` base ` ,這樣 Astro 才會將儲存庫名稱 (例如 ` /my-repo ` )視為網站的根目錄。
43+ 你可能需要設定 ` base ` ,這樣 Astro 才會將版本庫名稱 (例如 ` /my-repo ` )視為網站的根目錄。
4444
4545:::note
4646 如果你的情況符合以下其中之一,請不要設定 ` base ` 參數:
4747
4848- 如果你的頁面由根資料夾所提供。
49- - 如果你的原始碼儲存庫在 ` https://github.com/<USERNAME>/<USERNAME>.github.io ` 。
49+ - 如果你的原始碼版本庫在 ` https://github.com/<USERNAME>/<USERNAME>.github.io ` 。
5050:::
5151
52- ` base ` 的內容應該是你的儲存庫名稱 ,並以正斜線開頭,例如 ` /my-blog ` 。這樣做是為了讓 Astro 理解你的網站根目錄是 ` /my-repo ` ,而不是預設的 ` / ` 。
52+ ` base ` 的內容應該是你的版本庫名稱 ,並以正斜線開頭,例如 ` /my-blog ` 。這樣做是為了讓 Astro 理解你的網站根目錄是 ` /my-repo ` ,而不是預設的 ` / ` 。
5353
5454:::caution
5555 當設定了這個值後,你所有的內部頁面連結都必須以所設定的 ` base ` 值作為前綴:
@@ -99,7 +99,7 @@ export default defineConfig({
9999 # 允許你在 GitHub 上的 Actions 分頁中手動觸發此部署
100100 workflow_dispatch :
101101
102- # 允許這個工作複製儲存庫並建立頁面部署
102+ # 允許這個工作複製版本庫並建立頁面部署
103103 permissions :
104104 contents : read
105105 pages : write
@@ -114,9 +114,9 @@ export default defineConfig({
114114 - name : Install, build, and upload your site
115115 uses : withastro/action@v3
116116 # with:
117- # path: . # 儲存庫中 Astro 專案的根位置。(可選)
117+ # path: . # 版本庫中 Astro 專案的根位置。(可選)
118118 # node-version: 20 # 用於建置網站的特定 Node.js 版本,預設為 20。(可選)
119- # package-manager: pnpm@latest # 應該使用哪個 Node.js 套件管理器來安裝相依套件和建置網站,會根據儲存庫中的 lockfile 自動檢測。(可選)
119+ # package-manager: pnpm@latest # 應該使用哪個 Node.js 套件管理器來安裝相依套件和建置網站,會根據版本庫中的 lockfile 自動檢測。(可選)
120120
121121 deploy :
122122 needs : build
@@ -135,7 +135,7 @@ export default defineConfig({
135135 :: :
136136
137137 :::caution
138- 官方提供的 Astro [GitHub Action](https://github.com/withastro/action) 會透過掃描根目錄下的 lockfile 來檢查你所使用的套件管理器(如 `npm`、`yarn`、`pnpm` 或 `bun`)。正因如此,你應該將套件管理器自動產生的 `package-lock.json`、`yarn.lock`、`pnpm-lock.yaml` 或是 `bun.lockb` 檔案一起提交至你的儲存庫中 。
138+ 官方提供的 Astro [GitHub Action](https://github.com/withastro/action) 會透過掃描根目錄下的 lockfile 來檢查你所使用的套件管理器(如 `npm`、`yarn`、`pnpm` 或 `bun`)。正因如此,你應該將套件管理器自動產生的 `package-lock.json`、`yarn.lock`、`pnpm-lock.yaml` 或是 `bun.lockb` 檔案一起提交至你的版本庫中 。
139139 :: :
140140
1411412. (可選)如果你要在本地開發或預覽建置時傳遞環境變數到 Astro 專案,你需要在 `deploy.yml` 檔案定義所有公開的變數,這樣它們才會在部署至 GitHub Pages 時被處理。(要新增不公開的環境變數,請參閱 [GitHub 文件中關於設定秘密的部分](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#creating-configuration-variables-for-a-repository)。)
@@ -155,14 +155,14 @@ export default defineConfig({
155155 ` ` `
156156
157157
158- 3. 在 GitHub 網站上,請切換到儲存庫中的 **Settings** 分頁,並找到 **Pages** 部分。
158+ 3. 在 GitHub 網站上,請切換到版本庫中的 **Settings** 分頁,並找到 **Pages** 部分。
159159
1601604. 選擇 **GitHub Actions** 作為設定中的 **Source**。
161161
1621625. 將先前設定好的 workflow file 提交(Commit)並推送(Push)到 GitHub。
163163</Steps>
164164
165- 恭喜你!如此一來,你的 Astro 網站就會自動部署到 GitHub Pages 上了。如果你更改了你的網站原始碼並推送到前述的儲存庫 ,GitHub Actions 也會自動重新構建並部署你的網站,你不需要手動構建和部署。
165+ 恭喜你!如此一來,你的 Astro 網站就會自動部署到 GitHub Pages 上了。如果你更改了你的網站原始碼並推送到前述的版本庫 ,GitHub Actions 也會自動重新構建並部署你的網站,你不需要手動構建和部署。
166166
167167# # 範例
168168
0 commit comments