-
Notifications
You must be signed in to change notification settings - Fork 22
39 lines (32 loc) · 1.1 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
name: Update Calendar Files
on:
workflow_dispatch:
schedule:
- cron: '0 * * * *' # Adjust the schedule as necessary
jobs:
update-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v2
with:
ref: gh-pages # Specify to checkout the gh-pages branch
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: npm install
working-directory: .github/scripts
- name: Run script to update calendar files
run: npm start
working-directory: .github/scripts
env:
ICS_URL: ${{ secrets.ICS_URL }}
- name: Commit and push if there are changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git add ical/calendar.ics ical/calendar.json
git commit -m "Update calendar files" -a || echo "No changes to commit"
git push origin gh-pages