45 lines
1.2 KiB
YAML
45 lines
1.2 KiB
YAML
name: Deploy Docs to GitHub Pages
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main # Adjust this branch name if needed
|
|
|
|
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
|
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4.1.1
|
|
|
|
- name: Set up Rust
|
|
uses: ATiltedTree/setup-rust@v1.0.5
|
|
with:
|
|
rust-version: 1.74
|
|
|
|
- name: Build Docs
|
|
run: |
|
|
cargo doc --no-deps
|
|
rm -rf ./docs
|
|
echo "<meta http-equiv=\"refresh\" content=\"0; url=csflow/index.html\">" > target/doc/index.html
|
|
cp -r target/doc ./docs
|
|
|
|
- name: Deploy to GitHub Pages
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./docs
|