rose-pine-nix/.github/workflows/update-docs.yml
dependabot[bot] 948fe713ea
actions: bump cachix/install-nix-action from 24 to 25 (#72)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 24 to 25.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v24...v25)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-05 08:43:02 -05:00

51 lines
1.2 KiB
YAML

name: Update docs
on:
push:
branches: [main]
paths:
- "modules/home-manager/**"
- "modules/nixos/**"
workflow_dispatch:
jobs:
update:
name: Run update
runs-on: ubuntu-latest
permissions:
contents: write
# we only want this running on our repo
if: github.repository == 'Stonks3141/ctp-nix'
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v25
- name: Set Git user info
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Get short revision
id: rev
run:
echo "rev=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- name: Build & update docs
run: |
for module in "nixos" "home-manager"; do
nix build -L --show-trace ./dev#"$module"-doc
cat result > docs/"$module"-options.md
rm result
done
- name: Commit changes
run: |
if ! git diff --color=always --exit-code; then
git commit -am "docs: update for ${{ steps.rev.outputs.rev }}"
git push
fi