From 00247d33dbaa1503680fdf10dbbbcac8f1241af3 Mon Sep 17 00:00:00 2001 From: Eric Rescorla Date: Wed, 27 Nov 2024 14:56:40 -0800 Subject: [PATCH] Start from a different template --- .github/workflows/docs.yml | 59 ++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 18 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a91520f..5a829e3 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,28 +1,51 @@ -name: Build Docs +# Derived from: https://github.com/actions/starter-workflows/blob/main/pages/mdbook.yml +# +name: Deploy doc to Pages on: + # Runs on pushes targeting the default branch push: + branches: [$default-branch] -env: - CARGO_TERM_COLOR: always + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# 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 job build: - runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Pages + id: pages + uses: actions/configure-pages@v5 + - name: Buold docs + run: cargo doc --no-deps + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./docs + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build steps: - - uses: actions/checkout@v4 - - name: Build - run: cargo doc --no-deps - - uses: actions/checkout@v4 - with: - ref: gh-pages - clean: false - - name: Clean directory - run: rm -rf docs/api - - name: Copy docs - run: cp -pR target/doc docs/api - - name: Commit - run: git add docs/api - \ No newline at end of file + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file