Skip to content

Commit fbd2dc7

Browse files
committed
feat: Add automated deployment
1 parent dfb2eb2 commit fbd2dc7

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Deploy
2+
on:
3+
push:
4+
branches: [main]
5+
permissions:
6+
contents: write
7+
pages: write
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- run: |
14+
if [ -f "book/book.toml" ]; then
15+
curl -L https://github.com/rust-lang/mdBook/releases/download/v0.4.36/mdbook-v0.4.36-x86_64-unknown-linux-gnu.tar.gz | tar xz
16+
cd book && ../mdbook build
17+
fi
18+
mkdir -p dist
19+
if [ -d "book/book" ]; then cp -r book/book/* dist/; fi
20+
if [ -d "build" ]; then cp -r build/* dist/; fi
21+
if [ -d "docs" ]; then cp -r docs/* dist/; fi
22+
echo "# Deployed $(date)" > dist/index.html 2>/dev/null || true
23+
- uses: peaceiris/actions-gh-pages@v3
24+
with:
25+
github_token: ${{ secrets.GITHUB_TOKEN }}
26+
publish_dir: dist

0 commit comments

Comments
 (0)