Skip to content

Update Calendar Dates #237

Update Calendar Dates

Update Calendar Dates #237

# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Update Calendar Dates
# calendar_dates.txt is auto-generated at 12am every Wednesday morning and should be on the FTP server by 12:30am
# '0 11 * * WED' schedules the GitHub Action to run at 11:00 UTC (3am PTC) every Wednesday morning
# use '*/5 * * * *' for testing (GitHub Actions can be scheduled to run every 5 minutes)
# switch from scheduled to manual runs
# Uncomment below for auto runs:
on:
schedule:
- cron: '0 11 * * WED'
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M')"
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytz
pip install PyRSS2Gen
pip install requests
pip install python-dateutil
- name: Update weekly calendar_dates.txt
run: python update_gtfs.py
env:
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASS: ${{ secrets.FTP_PASS }}
SERVER: ${{ secrets.SERVER }}
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
- uses: EndBug/add-and-commit@v7
with:
message: Auto Updated on ${{ steps.date.outputs.date }}
committer_name: GitHub Actions
committer_email: [email protected]