Weekly KapeFiles Update #16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Weekly KapeFiles Update | |
| on: | |
| schedule: | |
| # Run every Monday at 00:00 UTC | |
| - cron: "0 0 * * 1" | |
| workflow_dispatch: | |
| # Allow manual triggering | |
| permissions: | |
| contents: write | |
| jobs: | |
| update-kapefiles-submodule: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| persist-credentials: true | |
| - name: Update KapeFiles submodule | |
| run: | | |
| git submodule update --remote --recursive src/content/kapefiles | |
| - name: Check for submodule changes | |
| id: changes | |
| run: | | |
| if git diff --quiet src/content/kapefiles; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Commit and push submodule update | |
| if: steps.changes.outputs.changed == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add src/content/kapefiles | |
| git commit -m "Update KapeFiles submodule" | |
| git push | |
| - name: Trigger Netlify Build | |
| if: steps.changes.outputs.changed == 'true' | |
| run: | | |
| curl -fsS -X POST -d '{}' "${{ secrets.NETLIFY_BUILD_HOOK }}" | |
| echo "Netlify build triggered for latest KapeFiles changes." |