name: Update Instance List

on:
  schedule:
    - cron: "0 0 * * *" # Runs at 00:00 UTC every day
  workflow_dispatch:

jobs:
  update:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
      - name: Install requirements
        run: pip install -r requirements.txt
      - name: Update Instances
        run: python update-instances.py
      - uses: EndBug/add-and-commit@v9
        with:
          default_author: github_actions
          message: "Update instances"
          add: ".upptimerc.yml"
