Skip to content

Commit 46d652a

Browse files
committed
fix
1 parent 1e11c5c commit 46d652a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+23
-8664
lines changed

.github/workflows/build-docs.yml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
1-
name: Build MkDocs into docs/
1+
name: Deploy MkDocs
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [main] # main ブランチへの push で自動実行
6+
workflow_dispatch: # 手動実行も可
77

88
jobs:
9-
build:
9+
build-and-deploy:
1010
runs-on: ubuntu-latest
11-
permissions:
12-
contents: write # ← git push を許可
1311

1412
steps:
15-
- uses: actions/checkout@v3
13+
# ① リポジトリ取得
14+
- uses: actions/checkout@v4
1615
with:
17-
token: ${{ secrets.GITHUB_TOKEN }} # ← これがないと403で止まる
16+
fetch-depth: 1
1817

19-
- name: Set up Python
20-
uses: actions/setup-python@v4
18+
# ② Python + MkDocs (Material) をセットアップ
19+
- uses: actions/setup-python@v5
2120
with:
22-
python-version: "3.12"
21+
python-version: '3.x'
2322

24-
- name: Install dependencies
25-
run: pip install mkdocs-material pymdown-extensions
23+
- name: Install MkDocs
24+
run: |
25+
pip install mkdocs-material # 必要に応じてテーマ・プラグインを追加
2626
27-
- name: Build MkDocs to docs/
28-
run: mkdocs build --clean --site-dir docs
27+
# ③ ドキュメントをビルド
28+
- name: Build site
29+
run: mkdocs build --clean # 出力先はデフォルトで ./site
2930

30-
- name: Commit built site
31-
run: |
32-
git config user.name "github-actions"
33-
git config user.email "github-actions@github.com"
34-
git add docs
35-
git commit -m "Auto-build site" || echo "No changes to commit"
36-
git push
31+
# ④ gh-pages ブランチへデプロイ
32+
- name: Deploy to GitHub Pages
33+
uses: peaceiris/actions-gh-pages@v4
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }} # リポジトリ自動付与の token
36+
publish_dir: ./site # ③で生成されたディレクトリ
37+
publish_branch: gh-pages # デフォルト。好きに変更可

0 commit comments

Comments
 (0)