From bbc0658344d40be3e7105d733c8414e452e4a2d7 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Tue, 3 Sep 2024 10:11:44 +0200 Subject: ci: docs --- .github/workflows/docs.yml | 62 ++++++++++++++++++---------------------------- 1 file changed, 24 insertions(+), 38 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c563bf5..89bc8a7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,48 +1,34 @@ -name: Docs +name: Deploy Rust Docs to GitHub Pages + on: push: - branches: [main] -permissions: - contents: read - pages: write - id-token: write -concurrency: - group: deploy - cancel-in-progress: false + branches: + - main + jobs: build: - name: Build runs-on: ubuntu-latest + steps: - name: Checkout repository - uses: actions/checkout@v4 - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable - - name: Configure cache - uses: Swatinem/rust-cache@v2 - - name: Setup pages - id: pages - uses: actions/configure-pages@v4 - - name: Clean docs folder - run: cargo clean --doc - - name: Build docs + uses: actions/checkout@v3 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Generate documentation run: cargo doc --no-deps + - name: Add redirect - run: echo '' > target/doc/index.html - - name: Remove lock file - run: rm target/doc/.lock - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: target/doc - deploy: - name: Deploy - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: + run: echo '' > target/doc/index.html + - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.TOKEN }} + publish_dir: ./target/doc + publish_branch: gh-pages + -- cgit v1.2.3-18-g5258