Skip to content

Commit

Permalink
Store only country name in cache for OpenStreetMap buffers (to avoid …
Browse files Browse the repository at this point in the history
…slash)
  • Loading branch information
jbelien committed Dec 20, 2024
1 parent 29d5068 commit d60c2d6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/actions/openstreetmap-buffers/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ inputs:
runs:
using: "composite"
steps:
- name: Extract continent/country from input
id: extract-country
run: |
echo "continent=$(echo ${{ inputs.country }} | cut -d'/' -f1)" >> $GITHUB_OUTPUT
echo "country=$(echo ${{ inputs.country }} | cut -d'/' -f2)" >> $GITHUB_OUTPUT
shell: bash
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
id: get-date
run: echo "date=$(date '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash
- name: Cache result
id: cache-buffers
Expand All @@ -19,7 +25,7 @@ runs:
path: |
openstreetmap-lines-buffers.geojson
openstreetmap-polygons-buffers.geojson
key: openstreetmap-buffers-${{ inputs.country }}-${{ steps.date.outputs.date }}
key: openstreetmap-buffers-${{ steps.extract-country.outputs.country }}-${{ steps.get-date.outputs.date }}
- name: Download OpenStreetMap extract
if: ${{ steps.cache-buffers.outputs.cache-hit != 'true' }}
run: wget -O openstreetmap-latest.osm.pbf https://download.geofabrik.de/${{ inputs.country }}-latest.osm.pbf
Expand Down

0 comments on commit d60c2d6

Please sign in to comment.