1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-26 21:19:45 +01:00

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 0ee5ab611d)
This commit is contained in:
Robert Helgesson 2023-06-25 00:27:30 +02:00
parent 3ac8421e1f
commit 6ca1e16eb3
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

34
.builds/manual.yml Normal file
View file

@ -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"