-
Notifications
You must be signed in to change notification settings - Fork 5
37 lines (30 loc) · 1.13 KB
/
update-publications.yml
File metadata and controls
37 lines (30 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Update Publications from Google Sheets
on:
schedule:
# Run every day at midnight UTC
- cron: '0 0 * * *'
workflow_dispatch: # Allow manual trigger
jobs:
update-publications:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: |
npm install googleapis@105
- name: Update publications from Google Sheets
env:
GOOGLE_SHEETS_ID: ${{ secrets.GOOGLE_SHEETS_ID }}
GOOGLE_SERVICE_ACCOUNT_KEY: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}
run: node scripts/update-publications.js
- name: Commit and push if changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add index.html
git diff --quiet && git diff --staged --quiet || (git commit -m "Auto-update publications from Google Sheets" && git push)