Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/preview-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Documentation

on:
pull_request_target:
branches:
- main

# Allow one concurrent deployment per PR
concurrency:
group: preview-docs-${{ github.event.pull_request.number }}
cancel-in-progress: false

jobs:
build:
name: Build
runs-on: ubuntu-latest

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: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

# Uses the build-docs action from the checked-out nixvim branch
# FIXME: is this secure? We just checked out the _user's_ branch...
# TODO: also sparse-checkout .github/actions from the main branch
- name: Build docs
uses: ./.github/actions/build-docs
with:
artifact-name: github-pages
base-href: # TODO: set this to the preview path

deploy:
name: Deploy
runs-on: ubuntu-24.04-arm
needs: build

permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

environment:
name: github-pages-preview
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
preview: ${{ github.event_name == 'pull_request_target' }}
2 changes: 1 addition & 1 deletion .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
ref: ${{ matrix.ref }}

# Uses the build-docs action from the checked-out nixvim branch
- name: Build docs
Expand Down
2 changes: 2 additions & 0 deletions docs/mdbook/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# NixVim - A Neovim configuration system for nix

Testing Testing 123

## Other versions of these docs

Please ensure you are referencing documentation that corresponds to the Nixvim version you are using!
Expand Down