From 011f7764be57c58ab9eff247b435aadebecd3051 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Sun, 15 Jun 2025 23:34:16 +0100 Subject: [PATCH 1/3] ci/docs: fix build ref MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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`. --- .github/workflows/website.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 674aac8d9a..4dd37e111f 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -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 From 8280b0edf42a5ee14a9a1af2ced4d46eb8711588 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Mon, 16 Jun 2025 00:28:39 +0100 Subject: [PATCH 2/3] ci/docs: add PR preview workflow --- .github/workflows/preview-docs.yml | 61 ++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/preview-docs.yml diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml new file mode 100644 index 0000000000..20804fa4b3 --- /dev/null +++ b/.github/workflows/preview-docs.yml @@ -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' }} From 77244db13441ee1d3de5ad70a8b9c622ebabdb33 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Mon, 16 Jun 2025 00:32:43 +0100 Subject: [PATCH 3/3] docs: add test string --- docs/mdbook/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/mdbook/index.md b/docs/mdbook/index.md index 1eab79bed7..fb4bd4c99a 100644 --- a/docs/mdbook/index.md +++ b/docs/mdbook/index.md @@ -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!