Skip to content

Fetch latest map .kml periodically #567

Fetch latest map .kml periodically

Fetch latest map .kml periodically #567

Workflow file for this run

name: Fetch latest map .kml periodically
# Controls when the action will run.
on:
workflow_dispatch:
schedule:
# Every day at '03:47'
# "Random" value to ensure it doesn't collide with peak scheduling hours
- cron: '47 3 * * *'
# permissions
permissions:
contents: write
packages: write
jobs:
fetch_map_and_commit:
runs-on: macos-latest
steps:
- uses: actions/checkout@master
- name: Run fetch script
run: bash fetch.sh
- name: Commit files
run: |
echo "Checking data on: `date`"
if [ -n "$(git status --porcelain)" ]; then
echo "New update available"
git config --local user.name actions-user
git config --local user.email "[email protected]"
git add *.kmz
git commit -am "Automatic data update - $(date '+%y%m%d_%H%M')"
git push origin master
else
echo "no changes to commit"
fi
env:
TZ: Europe/Paris