Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/sitemap_sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Sitemap Sync

on:
schedule:
- cron: "0 */4 * * *"
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
sync-sitemap:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm

- name: Install dependencies
run: npm ci

- name: Sync blog URLs to sitemap
run: npm run sitemap:sync-blogs

- name: Validate XML
run: xmllint --noout public/sitemap.xml

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: "chore(sitemap): sync new blog URLs from WordPress"
title: "chore(sitemap): sync new blog URLs"
body: |
Automated sitemap sync:
- Fetched latest blog slugs from WordPress
- Added missing `/blog/community/*` and `/blog/technology/*` URLs to `public/sitemap.xml`
branch: chore/sitemap-sync
delete-branch: true
labels: automation,sitemap
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"dev": "next",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"sitemap:sync-tech": "node scripts/sync-tech-urls-to-sitemap.mjs",
"sitemap:sync-blogs": "node scripts/sync-blog-urls-to-sitemap.mjs"
},
"dependencies": {
"@codemirror/lang-go": "^6.0.1",
Expand Down
Loading
Loading