Skip to content

Commit d51bb4c

Browse files
authored
Update main.yml
1 parent e6e3185 commit d51bb4c

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,35 @@ on:
55
pull_request:
66
branches: [ main ]
77

8+
# Add explicit permissions - this is crucial!
89
permissions:
9-
contents: write
10+
contents: write
1011

1112
jobs:
1213
build:
1314
name: Build, Test and Deploy
1415
runs-on: ubuntu-latest
1516
steps:
16-
- uses: actions/checkout@v4 # Update to v4
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0 # Important for git history
20+
1721
- uses: actions-rs/toolchain@v1
1822
with:
1923
toolchain: stable
24+
2025
- name: Install mdbook
2126
run: |
2227
mkdir bin
2328
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.14/mdbook-v0.4.14-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
2429
echo "$(pwd)/bin" >> $GITHUB_PATH
30+
2531
- run: mdbook build
26-
- name: Deploy 🚀
27-
uses: JamesIves/github-pages-deploy-action@v4 # Update to v4
32+
33+
- name: Deploy to GitHub Pages
34+
uses: JamesIves/github-pages-deploy-action@v4
2835
with:
29-
folder: book # The folder the action should deploy
36+
folder: book
37+
branch: gh-pages
38+
token: ${{ secrets.GITHUB_TOKEN }} # Explicitly use the token
39+
clean: true # Clean up old files

0 commit comments

Comments
 (0)