Create main.yml

This commit is contained in:
2025-03-24 14:19:16 +11:00
committed by GitHub
parent a0e83e1df3
commit 1269926a07

40
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: Build Documentation Index
on:
push:
paths:
- 'docs/**'
branches:
- main
repository_dispatch:
types: [build_docs]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Build docs
run: node build-docs.js
- name: Check for changes
id: check_changes
run: |
git diff --quiet index.json || echo "changes=true" >> $GITHUB_OUTPUT
- name: Commit and push if changed
if: steps.check_changes.outputs.changes == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add index.json
git commit -m "Update documentation index"
git push