From 6ca1e16eb3016c94b7ac16699e1d4158bd4e39a4 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 25 Jun 2023 00:27:30 +0200 Subject: [PATCH] ci: build manual and push to home-manager.dev This builds the manual on builds.sr.ht and pushes it for availability on https://home-manager.dev/manual/unstable or https://home-manager.dev/manual/{version} depending on which release branch is built. (cherry picked from commit 0ee5ab611dc1fbb5180bd7d88d2aeb7841a4d179) --- .builds/manual.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .builds/manual.yml diff --git a/.builds/manual.yml b/.builds/manual.yml new file mode 100644 index 00000000..af257412 --- /dev/null +++ b/.builds/manual.yml @@ -0,0 +1,34 @@ +image: nixos/unstable +sources: + - https://git.sr.ht/~rycee/home-manager +secrets: + - 01ad357c-3214-4f73-bb7e-2441e440cc51 + - 7d16ccc0-1c4f-4fd6-91c1-c54fc0f5807f + - bd5f26ee-78b8-4a6f-9d68-8d8f53a068f1 +environment: + NIX_CONFIG: "experimental-features = nix-command flakes" +packages: + - nixos.cachix +tasks: + - setup: | + cachix use rycee + - build: | + cd ./home-manager + gitBranch="$(git show -s --pretty=%D HEAD | sed '{ s/.*, //; s!origin/!!; }')" + [[ $gitBranch == master || $gitBranch == release-??.?? ]] || exit 0 + nix build -L .#docs-html + cachix push rycee ./result + - deploy: | + cd ./home-manager + gitBranch="$(git show -s --pretty=%D HEAD | sed '{ s/.*, //; s!origin/!!; }')" + [[ $gitBranch == master || $gitBranch == release-??.?? ]] || exit 0 + + if [[ $gitBranch == master ]]; then + dirName="unstable" + else + dirName="$(cat .release)" + fi + + rsync --delete -r --info=stats \ + "result/share/doc/home-manager/" \ + "hm-web:/srv/www/home-manager.dev/manual/$dirName"