From 3f24f7ff23ad085f4f5ae5a5b98d2945eaf32482 Mon Sep 17 00:00:00 2001 From: Nick Spinale Date: Sun, 30 Jul 2023 22:22:50 +0100 Subject: [PATCH] ci: Deploy docs to GitHub Pages using GitHub Actions --- .github/workflows/check.yaml | 31 ----------------- .github/workflows/push.yaml | 56 ++++++++++++++++++++++++++++++ README.md | 2 +- hacking/ci/github-actions/Makefile | 4 +++ 4 files changed, 61 insertions(+), 32 deletions(-) delete mode 100644 .github/workflows/check.yaml create mode 100644 .github/workflows/push.yaml diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml deleted file mode 100644 index 44254920c..000000000 --- a/.github/workflows/check.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: "Check" -on: - pull_request: - workflow_dispatch: -jobs: - check-everything: - name: Check everything - runs-on: ubuntu-latest - steps: - - name: Prepare to maximize build space - run: sudo mkdir /nix - - name: Maximize build space - uses: easimon/maximize-build-space@master - with: - build-mount-path: /nix - root-reserve-mb: 8192 - remove-dotnet: 'true' - remove-android: 'true' - remove-haskell: 'true' - remove-codeql: 'true' - remove-docker-images: 'true' - - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v22 - with: - nix_path: nixpkgs=channel:nixos-unstable - - uses: cachix/cachix-action@v12 - with: - name: coliasgroup - authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - - name: Run checks - run: make -C hacking/ci/github-actions check diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml new file mode 100644 index 000000000..981b60325 --- /dev/null +++ b/.github/workflows/push.yaml @@ -0,0 +1,56 @@ +name: "CI" +on: + push: + branches: + - main + pull_request: + workflow_dispatch: +jobs: + build-and-check: + name: Build and check + runs-on: ubuntu-latest + steps: + - name: Prepare to maximize build space + run: sudo mkdir /nix + - name: Maximize build space + uses: easimon/maximize-build-space@master + with: + build-mount-path: /nix + root-reserve-mb: 8192 + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v22 + with: + nix_path: nixpkgs=channel:nixos-unstable + - uses: cachix/cachix-action@v12 + with: + name: coliasgroup + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - name: Build and check + run: make -C hacking/ci/github-actions check + - name: Expose docs + run: make -C hacking/ci/github-actions docs + - name: Upload Pages artifact + if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) + uses: actions/upload-pages-artifact@v2 + with: + path: out/html + deploy-docs: + name: Deploy docs + if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) + needs: build-and-check + permissions: + pages: write + id-token: write + 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@v2 diff --git a/README.md b/README.md index 72a9777ac..1f96932cf 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ This work is funded by the [seL4 Foundation](https://sel4.systems/Foundation/hom ### Rendered rustdoc -[https://coliasgroup.com/rust-seL4-html/](https://coliasgroup.com/rust-seL4-html/) +[https://coliasgroup.com/rust-seL4/](https://coliasgroup.com/rust-seL4/) ### Overview of crates diff --git a/hacking/ci/github-actions/Makefile b/hacking/ci/github-actions/Makefile index 2f177f4a0..a97fae79f 100644 --- a/hacking/ci/github-actions/Makefile +++ b/hacking/ci/github-actions/Makefile @@ -9,3 +9,7 @@ check: # For debugging and monitoring disk usage # ($(MAKE) -C $(root_dir) check-oneshot && df -h) || (df -h && false) + +.PHONY: docs +docs: + $(MAKE) -C $(root_dir) html