From 0f3a17a802f3c13ed358d3d46b146ed5893f7e55 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 10 Nov 2024 13:18:25 +0800 Subject: [PATCH] ci: add build site job --- .github/workflows/site.yml | 32 ++++++++++++++++++++++++++++++++ Makefile | 4 ++++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/site.yml diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml new file mode 100644 index 0000000..a5f08a9 --- /dev/null +++ b/.github/workflows/site.yml @@ -0,0 +1,32 @@ +name: Deploy documentation site +on: + push: + branches: [master] + +jobs: + build-site: + name: Build website + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@v15 + - run: make build + - name: Upload artifact + id: deployment + uses: actions/upload-pages-artifact@v3 + with: + path: result/ + deploy-site: + name: Deploy website + needs: build-site + 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@v4 diff --git a/Makefile b/Makefile index 99b8d52..aadd9eb 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,10 @@ docs-serve: docs-build: hugo -s docs/website +.PHONY: build +build: + { command -v nix >/dev/null && nix build -f docs/ website; } || { nix-build docs/ -A website; } + .PHONY: check check: { command -v nix > /dev/null && nix flake check; } || { nix-build tests -A configs -A lib; }