-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (39 loc) · 1.3 KB
/
update-workshops.yml
File metadata and controls
46 lines (39 loc) · 1.3 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
38
39
40
41
42
43
44
45
46
name: Update Workshop Data from Google Sheets
on:
schedule:
# Run daily at 8 AM UTC (1 AM PST)
- cron: '0 8 * * *'
workflow_dispatch: # Allow manual triggering
jobs:
update-workshops:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client
- name: Fetch workshop data from Google Sheets
env:
GOOGLE_SHEET_ID: ${{ secrets.GOOGLE_SHEET_ID }}
GOOGLE_SERVICE_ACCOUNT_KEY: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}
run: |
python scripts/fetch_google_sheets.py
- name: Commit and push changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add _data/upcoming_workshops.json
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "Update upcoming workshops data [skip ci]"
git push
fi