diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 0000000..913b753 --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,37 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Sync data + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + schedule: + - cron: '53 5 * * *' + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + environment: dev + + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3 + uses: actions/setup-python@v3 + with: + python-version: "3.13" + - name: Install dependencies + run: | + pip install poetry + poetry install + - name: Run + run: | + poetry run python -m sync + env: + AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }} diff --git a/sync.py b/sync.py index 4efa4b1..c185ba6 100644 --- a/sync.py +++ b/sync.py @@ -18,7 +18,7 @@ def log(message): ctfg = api.table(bases['timCopy'], 'Listings') -def get_ctfg(from_cache=True): +def get_ctfg(from_cache=False): log('Getting airtable records...') cache_fp = 'cache/ctfg.pickle' if from_cache: