From 61ba37cd0d439c3dfacf82a3e0179d5c65c62d99 Mon Sep 17 00:00:00 2001 From: Nathan Graule Date: Sat, 20 Jan 2024 12:51:57 +0100 Subject: [PATCH] doc: build and deploy doc from Nix to GitHub Pages --- .github/workflows/documentation.yml | 39 +++++++++++++++++++++++++++++ src/lib.rs | 1 + 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/documentation.yml diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..6777641 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,39 @@ +name: Documentation +on: + push: + branches: [main] + +jobs: + doc: + name: Documentation + runs-on: ubuntu-22.04 + steps: + - name: Install Nix + uses: cachix/install-nix-action@v25 + - name: Cache Nix derivations + uses: DeterminateSystems/magic-nix-cache-action@v2 + - uses: actions/checkout@v2 + - name: Fetch all git history + run: git fetch --force --prune --tags --unshallow + - name: Build documentation + run: nix build .#workspace.doc + - name: Fix permissions + run: | + chmod -c -R +rX "_site/" | while read line; do + echo "::warning title=Invalid file permissions automatically fixed::$line" + done + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v2 + doc-deploy: + needs: doc + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index d68f604..af00819 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,4 @@ +#![doc = include_str!("../README.md")] use az::CastFrom; use num_traits::Zero; use simba::simd::{AutoSimd, SimdRealField, SimdValue};