Skip to content

Commit

Permalink
Update chaching strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Aug 5, 2024
1 parent 7228754 commit cd54f3f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,30 @@ jobs:
- name: use mobility.api.opendatahub.testingmachine.eu for testing
run: sed -i 's/mobility.api.opendatahub.com/mobility.api.opendatahub.testingmachine.eu/' */config.yml

# elevation data does not change so we cache it forever
- name: Cache OSM and elevation data
uses: actions/cache@v4
with:
path: |
data/srtm*
key: elevation

# OSM data changes every day, so we cache a monthly download and apply the daily updates to it
# ideally we also put the updated file back into the cache but Github CI doesn't allow you to
# do that without jumping through many hoops.
# Therefore, we take the version from the beginning of the month and apply more and more daily
# updates until the next month triggers a complete download.
- name: Set variable OSM_CACHE_VERSION
run: |
echo "OSM_CACHE_VERSION=$(date +%Y-%m)" >> $GITHUB_ENV
- name: Cache OSM and elevation data
uses: actions/cache@v4
with:
path: |
data/italy-nord-est.osm.pbf
key: osm-${{ env.OSM_CACHE_VERSION }}

- name: Build graph
run: bash build-graph.sh

Expand Down

0 comments on commit cd54f3f

Please sign in to comment.