From e63bdae99eb4b91ee5d2c76a4f22772e6583f336 Mon Sep 17 00:00:00 2001 From: Thomas Churchman Date: Fri, 3 May 2024 14:23:11 +0200 Subject: [PATCH] github: add build and publish workflow --- .github/workflows/build-site.yml | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/build-site.yml diff --git a/.github/workflows/build-site.yml b/.github/workflows/build-site.yml new file mode 100644 index 0000000..0a409e2 --- /dev/null +++ b/.github/workflows/build-site.yml @@ -0,0 +1,46 @@ +name: build-site + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v20 + with: + nix_path: nixpkgs=channel:nixos-unstable + - name: Build Sprokkel + run: nix build .#sprokkel + + - name: Build site + run: ./result/bin/sprokkel build ./example/sprokkel.uint.one + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./out + + deploy: + runs-on: ubuntu-latest + needs: build + + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: Deploy site + id: deployment + uses: actions/deploy-pages@v4