Update Calendars #560
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Calendars | |
on: | |
schedule: | |
- cron: '0 7 * * *' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
update_calendars: | |
environment: Matttma | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v4 # checkout the repository content | |
- name: setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' # install the python version needed | |
- name: install requirements | |
working-directory: src/ | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: update calendars | |
working-directory: src/ | |
env: | |
PROD_ID: ${{ vars.PROD_ID }} | |
URL_MATTTMA: ${{ secrets.URL_MATTTMA }} | |
run: python update.py ../calendars/ $PROD_ID $URL_MATTTMA | |
- name: commit and push | |
run: | | |
git config --global user.name 'Calendar Bot' | |
git config --global user.email 'calendar-bot@users.noreply.github.com' | |
git add -A | |
git commit -am "daily calendar update" || true | |
git push |