From e2827a1a79595725bdcced17b6f5dcd223769155 Mon Sep 17 00:00:00 2001
From: strawberry <strawberry@puppygock.gay>
Date: Sun, 17 Mar 2024 18:17:46 -0400
Subject: [PATCH] build documentation/book in github actions

Signed-off-by: strawberry <strawberry@puppygock.gay>
---
 .github/workflows/ci.yml | 17 ++++++++++++++++-
 .gitlab-ci.yml           |  2 +-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ba65a49c..ca006a51 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -154,6 +154,21 @@ jobs:
           compression-level: 0
 
 
+      - name: Build documentation (book)
+        run: |
+          ./bin/nix-build-and-cache .#book
+          cp -r --dereference result public
+
+      - name: Upload generated documentation (book) as artifact
+        uses: actions/upload-artifact@v4
+        with:
+          name: public
+          path: public
+          if-no-files-found: error
+          # don't compress again
+          compression-level: 0
+
+
       - name: Extract metadata for Dockerhub
         env:
           REGISTRY: registry.hub.docker.com
@@ -247,4 +262,4 @@ jobs:
           if [[ -n "$GITHUB_REF_NAME" ]]; then
             docker manifest create $IMAGE_NAME:latest --amend $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_AMD64 --amend $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_ARM64V8
             docker manifest push $IMAGE_NAME:latest
-          fi
\ No newline at end of file
+          fi
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 348fcdd5..ce9b464a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -116,7 +116,7 @@ artifacts:
       - x86_64-unknown-linux-musl.deb
       - oci-image-amd64.tar.gz
       - oci-image-arm64v8.tar.gz
-            - public
+      - public
   rules:
     # CI required for all MRs
     - if: $CI_PIPELINE_SOURCE == "merge_request_event"