Skip to content

Commit

Permalink
Added flows to update gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoabernier authored Apr 13, 2024
1 parent 1de89f1 commit d7619f5
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/update-ics.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
name: Download and Store ICS File
name: Update Calendar Files

on:
workflow_dispatch: # Allows manual trigger
workflow_dispatch:
schedule:
- cron: '0 * * * *' # Adjust the schedule as necessary

jobs:
download-and-save-ics:
update-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
- 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
Expand All @@ -20,19 +24,16 @@ jobs:
run: npm install
working-directory: .github/scripts

- name: Run script to download ICS
env:
ICS_URL: ${{ secrets.ICS_URL }} # Set the environment variable using the secret
- name: Run script to update calendar files
run: npm start
working-directory: .github/scripts

- name: Check git status
run: git status
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/* --verbose
git commit -m "Update ICS and JSON files" -a --verbose || echo "No changes to commit"
git push --verbose
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

0 comments on commit d7619f5

Please sign in to comment.