docs: only set base-href in CI built docs

This reverts commit c12e59ff7c
This commit is contained in:
Matt Sturgeon 2024-11-18 19:31:12 +00:00
parent cdbda982f0
commit 99b066ba6d
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
3 changed files with 32 additions and 10 deletions

View file

@ -26,6 +26,9 @@ jobs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
repo: "${{ github.repository }}"
repoName: "${{ github.event.repository.name }}"
out: docs-build
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
@ -40,14 +43,33 @@ jobs:
name: nix-community
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- run: |
- name: Build docs
run: |
set -ex
mkdir -p docs-build
nix build github:nix-community/nixvim#docs
cp -r result/share/doc/nixvim/* docs-build
nix build github:nix-community/nixvim/nixos-24.05#docs
# TODO: use the new path when 24.11 hits
cp -r result/share/doc docs-build/stable
# 1: branch
# 2: dest-dir (relative to /nixvim/)
build() {
flake="github:${repo}${1:+/$1}"
baseHref="/${repoName}/${2:+$2/}"
destDir="${out}${baseHref}"
# Build docs for the given flake ref, overriding baseHref in the derivation args
nix build --impure --expr '(builtins.getFlake "'"$flake"'").outputs.packages.${builtins.currentSystem}.docs.override {
baseHref = "'"$baseHref"'";
}'
# Copy the result to the dest-dir
mkdir -p "$destDir"
cp -r result/share/doc/* "$destDir"
}
# Install main-branch docs at the top-level
build 'main' ''
# Install 24.05 docs under 'stable'
# TODO: consider having `<release>` instead of `stable`
build 'nixos-24.05' 'stable'
- name: Upload artifact
uses: actions/upload-pages-artifact@v3