Skip to content

Commit ac3c398

Browse files
authored
Update "Github Pages" section of hosting.md
1 parent 8285187 commit ac3c398

File tree

1 file changed

+40
-11
lines changed

1 file changed

+40
-11
lines changed

guide/hosting.md

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,27 +95,56 @@ Vercelのダッシュボードを開き、リポジトリを指定して新し
9595

9696
- [GitHub Pages](https://pages.github.com/)
9797

98-
GitHub Actionsを使用してGitHub Pagesにスライドをデプロイするために、以下の内容で`.github/workflows/deploy.yml`を作成してください。
98+
GitHub Pagesにデプロイするには:
99+
100+
- プロジェクトのすべてのファイルをリポジトリ(例:`name_of_repo`)にアップロードします。
101+
- `.github/workflows/deploy.yml`というファイルを作成し、以下の内容を記述して、GitHub Actions経由でスライドをGitHub Pagesにデプロイします。`<name_of_repo>``name_of_repo`に置き換えます。このとき、前後のスラッシュはそのまま残してください。
99102

100103
```yaml
101104
name: Deploy pages
102-
on: push
105+
106+
on:
107+
workflow_dispatch: {}
108+
push:
109+
branches:
110+
- main
111+
103112
jobs:
104113
deploy:
105114
runs-on: ubuntu-latest
115+
116+
permissions:
117+
contents: read
118+
pages: write
119+
id-token: write
120+
121+
environment:
122+
name: github-pages
123+
url: ${{ steps.deployment.outputs.page_url }}
124+
106125
steps:
107-
- uses: actions/checkout@v2
108-
- uses: actions/setup-node@v2
126+
- uses: actions/checkout@v4
127+
128+
- uses: actions/setup-node@v4
109129
with:
110-
node-version: '14'
130+
node-version: 'lts/*'
131+
111132
- name: Install dependencies
112133
run: npm install
134+
113135
- name: Build
114-
run: npm run build
115-
- name: Deploy pages
116-
uses: crazy-max/ghaction-github-pages@v2
136+
run: npm run build -- --base /${{github.event.repository.name}}/
137+
138+
- uses: actions/configure-pages@v4
139+
140+
- uses: actions/upload-pages-artifact@v3
117141
with:
118-
build_dir: dist
119-
env:
120-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142+
path: dist
143+
144+
- name: Deploy
145+
id: deployment
146+
uses: actions/deploy-pages@v4
121147
```
148+
149+
- リポジトリ内で、Settings > Pagesに移動します。"Build and deployment"の項目で、"GitHub Actions"を選択します。
150+
- 最後に、すべてのワークフローが実行された後、Settings > Pagesの下にスライドへのリンクが表示されるはずです。

0 commit comments

Comments
 (0)