nix-community.nixvim/.github/workflows/website.yml
Matt Sturgeon 7176d51a34 ci/docs: run non-build jobs on ARM
This may be marginally slower, but should be more efficient.

Continue using x86 for the main build as it will be faster.
2025-06-15 21:24:10 +00:00

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: ${{ inputs.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