rose-pine-nix/.github/workflows/update-docs.yml
seth 5b5648c10e
chore(modules): factor out option doc generation (#152)
* chore(modules): factor out option doc generation

* ci: only validate sources on pushes to main
2024-04-29 16:21:14 -04:00

49 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
# we only want this running on our repo
if: github.repository == 'catppuccin/nix'
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PUSH_TOKEN }}
- name: Install Nix
uses: cachix/install-nix-action@v26
- 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 --print-build-logs --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