mirror of
https://github.com/suyu-emu/website.git
synced 2026-09-21 14:17:45 -07:00
40 lines
1.1 KiB
YAML
40 lines
1.1 KiB
YAML
name: Fetch Reddit Blog Posts
|
|
|
|
on:
|
|
workflow_dispatch: # run manually from the Actions tab
|
|
schedule:
|
|
- cron: "0 4 * * 1" # every Monday at 04:00 UTC
|
|
|
|
jobs:
|
|
fetch:
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: dev
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 23
|
|
|
|
- name: Fetch Reddit post content
|
|
run: node scripts/fetch-reddit-posts.mjs
|
|
|
|
- name: Commit updated blog content
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git add src/content/blog/
|
|
if git diff --cached --quiet; then
|
|
echo "No changes to commit."
|
|
else
|
|
git commit -m "chore(blog): refresh Reddit post content [skip ci]"
|
|
git push
|
|
fi
|