mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
Some checks are pending
Publish every Git push to main to FlakeHub / flakehub-publish (push) Waiting to run
Publish every git push to Flakestry / publish-flake (push) Waiting to run
Documentation / Build unstable (push) Waiting to run
Documentation / Build 24.11 (push) Waiting to run
Documentation / Build 25.05 (push) Waiting to run
Documentation / Combine builds (push) Blocked by required conditions
Documentation / Deploy (push) Blocked by required conditions
Fix typo `inputs.ref` → `matrix.ref`.
This caused an empty string to be assigned to the checkout action's
`ref` input, meaning it used its default value `github.ref`.
Therefore all "versions" of the docs were actually building `main` 😂
Instead, we actually want to checkout the ref from the job's `matrix`.
128 lines
3.1 KiB
YAML
128 lines
3.1 KiB
YAML
name: Documentation
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
# Allow running manually
|
|
workflow_dispatch:
|
|
|
|
# Allow one concurrent deployment
|
|
concurrency:
|
|
group: docs-website
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
name: Build ${{ matrix.name }}
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
# TODO: generate matrix from version-info.toml
|
|
include:
|
|
- name: unstable
|
|
ref: main
|
|
sub-path: ""
|
|
base-href: /nixvim/
|
|
- name: "25.05"
|
|
ref: nixos-25.05
|
|
sub-path: "25.05"
|
|
base-href: /nixvim/25.05/
|
|
- name: "24.11"
|
|
ref: nixos-24.11
|
|
sub-path: "24.11"
|
|
base-href: /nixvim/24.11/
|
|
|
|
steps:
|
|
- name: Install nix
|
|
uses: cachix/install-nix-action@v31
|
|
|
|
- name: Configure cachix
|
|
uses: cachix/cachix-action@v16
|
|
with:
|
|
name: nix-community
|
|
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ matrix.ref }}
|
|
|
|
# Uses the build-docs action from the checked-out nixvim branch
|
|
- name: Build docs
|
|
uses: ./.github/actions/build-docs
|
|
with:
|
|
artifact-name: ${{ matrix.name }}-docs
|
|
sub-path: ${{ matrix.sub-path }}
|
|
base-href: ${{ matrix.base-href }}
|
|
# TODO: generate JSON from version-info.toml
|
|
versions: >
|
|
[
|
|
{
|
|
"branch": "main",
|
|
"nixpkgsBranch": "nixos-unstable",
|
|
"baseHref": "/nixvim/"
|
|
},
|
|
{
|
|
"branch": "nixos-25.05",
|
|
"nixpkgsBranch": "nixos-25.05",
|
|
"baseHref": "/nixvim/25.05/"
|
|
},
|
|
{
|
|
"branch": "nixos-24.11",
|
|
"nixpkgsBranch": "nixos-24.11",
|
|
"baseHref": "/nixvim/24.11/"
|
|
}
|
|
]
|
|
|
|
combine:
|
|
name: Combine builds
|
|
runs-on: ubuntu-24.04-arm
|
|
needs: build
|
|
|
|
env:
|
|
in: artifacts
|
|
out: combined
|
|
|
|
steps:
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: ${{ env.in }}
|
|
pattern: "*-docs"
|
|
merge-multiple: false
|
|
|
|
- name: Extract archives
|
|
run: |
|
|
mkdir -p "$out"
|
|
find "$in" -name artifact.tar \
|
|
| parallel tar \
|
|
--verbose \
|
|
--extract \
|
|
--file {} \
|
|
--directory "$out"
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: ${{ env.out }}
|
|
|
|
deploy:
|
|
name: Deploy
|
|
runs-on: ubuntu-24.04-arm
|
|
needs: combine
|
|
|
|
permissions:
|
|
pages: write # to deploy to Pages
|
|
id-token: write # to verify the deployment originates from an appropriate source
|
|
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|