Skip to content
Merged
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
43 changes: 43 additions & 0 deletions .github/workflows/gcal-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: GCal Sync

on:
schedule:
- cron: '0 4 * * *' # Daily at 04:00 UTC
workflow_dispatch: # Manual trigger

jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: firethunder.github.io/package-lock.json

- name: Install dependencies
run: npm ci
working-directory: firethunder.github.io

- name: Run GCal Sync
run: npm run sync-gcal
working-directory: firethunder.github.io

- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add public/ffwtool/termine.json
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "chore(data): automated gcal sync"
git push
fi
working-directory: firethunder.github.io
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"build:pwa": "vite build -c vite.pwa.config.js && node scripts/post-build-pwa.js",
"preview": "vite preview",
"preview:pwa": "vite preview -c vite.pwa.config.js --port 4173 --strictPort",
"sync-gcal": "node scripts/sync-gcal-headless.js",
"test": "vitest run"
},
"dependencies": {
Expand Down
Loading