lugcal/.gitea/workflows/update-calendar.yaml

57 lines
1.2 KiB
YAML

name: Update Calendar
on:
push:
branches:
- main
paths:
- 'meetings.yaml'
- 'generate_calendar.py'
- '.gitea/workflows/update-calendar.yaml'
schedule:
# Run daily at 00:00 UTC
- cron: '0 0 * * *'
workflow_dispatch:
concurrency:
group: update-calendar
cancel-in-progress: true
jobs:
update-calendar:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install pyyaml
- name: Pull latest changes
run: |
git config --local user.email "noreply@thelinuxcast.org"
git config --local user.name "Calendar Bot"
git pull origin main
- name: Generate calendar files
run: |
python generate_calendar.py
- name: Commit and push changes
run: |
git add calendar.ics README.md
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "Auto-update calendar files
🤖 Generated with automation"
git push
fi