Skip to content

Commit aee992a

Browse files
committed
docs(static-deploy): clarify GitHub Pages instructions (enable + workflow)
1 parent 2977604 commit aee992a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

guide/static-deploy.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,25 @@ $ npm run preview
5555

5656
## GitHub Pages
5757

58-
1. `vite.config.js``base` を正しく設定してください。
58+
1. **Vite の設定を更新**
59+
60+
`vite.config.js``base` を正しく設定してください。
5961

6062
`https://<USERNAME>.github.io/` や、GitHub Pages 経由のカスタムドメイン(例 `www.example.com`)にデプロイする場合、`base``'/'` に設定します。デフォルトは `'/'` なので、設定から `base` を削除することもできます。
6163

6264
`https://<USERNAME>.github.io/<REPO>/` にデプロイする場合(例: リポジトリーは `https://github.com/<USERNAME>/<REPO>`)、`base``'/<REPO>/'` と設定してください。
6365

64-
2. リポジトリー設定ページにある GitHub Pages の設定から、デプロイ元を "GitHub Actions" にすることで、プロジェクトをビルドしてデプロイするワークフローを作成できます。npm を使用して依存関係をインストールし、ビルドするサンプルワークフローが提供されています:
66+
2. **GitHub Pages を有効化**
67+
68+
リポジトリーで **Settings → Pages** に移動します。**Build and deployment** の下にある **Source** ドロップダウンを開き、**GitHub Actions** を選択します。
69+
70+
Vite はデプロイにビルドステップが必要なため、GitHub は GitHub Actions の [ワークフロー](https://docs.github.com/ja/actions/about-github-actions/understanding-github-actions)を使用してサイトをデプロイするようになります。
71+
72+
3. **ワークフローを作成**
73+
74+
リポジトリーの `.github/workflows/deploy.yml` に新しいファイルを作成します。前のステップから **"create your own"** をクリックすることもでき、その場合はスターターワークフローファイルが生成されます。
75+
76+
以下は、npm で依存関係をインストールし、サイトをビルドして、`main` ブランチに変更をプッシュするたびにデプロイするサンプルワークフローです:
6577

6678
<<< ./static-deploy-github-pages.yaml#content[.github/workflows/deploy.yml]
6779

0 commit comments

Comments
 (0)