-
Notifications
You must be signed in to change notification settings - Fork 22
48 lines (40 loc) · 1.38 KB
/
update-ics.yaml
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
47
48
name: Update ICAL Files
on:
push:
branches:
- main # Trigger on push to main, or adjust as needed
schedule:
- cron: '0 12 * * *' # Optionally, schedule to run daily
jobs:
update-ical:
name: Get ICS and Process
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main # Specify the branch to checkout
path: main
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages # Specify the branch to checkout
path: gh-pages
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '14' # Specify your Node.js version
- name: Install dependencies
run: npm install # Assuming your script needs npm packages
working-directory: ./main/.github/scripts
- name: Update ICAL File
run: node index.js --action # Run your specific script
working-directory: ./main/.github/scripts
- name: Commit and push if there are changes
run: |
cd gh-pages
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git add calendar.ics ical/calendar.json
git commit -m "Update calendar files" -a || echo "No changes to commit"
git push origin gh-pages