Skip to content

Merge multiple layers #36

Merge multiple layers

Merge multiple layers #36

Workflow file for this run

name: Merge multiple layers
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
AREA: north-america
#AREA: nova-scotia
steps:
- name: Maximize build space
uses: AdityaGarg8/remove-unwanted-software@v2
with:
remove-android: 'true'
remove-dotnet: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Fetch tiles
env:
AWS_ENDPOINT_URL: https://ce5627cfc65c8b54d40bb91c0ba7298b.r2.cloudflarestorage.com
AWS_EC2_METADATA_DISABLED: true
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: sudo mkdir /mnt/layers && sudo chown runner:docker /mnt/layers && cd /mnt/layers && aws s3 sync s3://hikes-public/layers/"$AREA"/ . --no-progress
- name: tile-join
#run: ./bin/docker-tile-join --no-tile-size-limit -o tiles.mbtiles /mnt/layers/*.mbtiles
run: ./bin/docker-tile-smush /mnt/layers/*.mbtiles
- name: Free up space
run: df -h && rm -f /mnt/layers/*.mbtiles && ls -l /mnt/layers && df -h
- name: convert to pmtiles
run: ./bin/docker-pmtiles convert --tmpdir /mnt/layers merged.mbtiles /mnt/layers/tiles.pmtiles
- name: Upload tiles
env:
AWS_ENDPOINT_URL: https://ce5627cfc65c8b54d40bb91c0ba7298b.r2.cloudflarestorage.com
AWS_EC2_METADATA_DISABLED: true
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: aws s3 cp --no-progress /mnt/layers/tiles.pmtiles s3://hikes-public/"$AREA".pmtiles