Skip to content

Refresh live environment #741

Refresh live environment

Refresh live environment #741

name: Refresh live environment
on:
schedule:
# Hourly, at :17 past the hour (UTC). Buoys report ~hourly; offset avoids
# the top-of-hour cron rush.
- cron: "17 * * * *"
workflow_dispatch:
permissions:
contents: write
concurrency:
group: live-environment
cancel-in-progress: true
jobs:
refresh:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Fetch latest environmental observations
run: python3 scripts/build_live_temperature.py
- name: Commit snapshot if changed
run: |
if git diff --quiet -- src/data/liveTemperature.json; then
echo "No change in liveTemperature.json"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add src/data/liveTemperature.json
git commit -m "Refresh live environmental snapshot"
git push