planet-file-updater/.forgejo/workflows/update_daily.yml

38 lines
1 KiB
YAML

on:
workflow_dispatch:
schedule:
- cron: "0 2 * * *"
jobs:
update_planet_file:
runs-on: [ osm-cache ]
steps:
- uses: https://source.mapcomplete.org/actions/checkout@v4
- name: Print root directory
shell: bash
run: ls /
- name: Download the planet file
shell: bash
run: |
# https://planet.openstreetmap.org/pbf/planet-latest.osm.pbf
wget https://download.openplanetdata.com/osm/planet/pbf/planet-latest.osm.pbf -O /data/planet-latest.osm.pbf.part
- name: Move the planet file
shell: bash
run: mv -f /data/planet-latest.osm.pbf.part /data/planet-latest.osm.pbf
- name: Print download date
shell: bash
run: date --iso > /data/planet_download_date.txt
- name: Print planet file date
shell: bash
run: |
TIMESTAMP=$(osmium fileinfo /data/planet-latest.osm.pbf -g header.option.timestamp)
DATE=$(echo $TIMESTAMP | sed "s/T.*//")
echo $DATE
echo $DATE /data/planet_version.txt