diff --git a/.github/workflows/mbtiles-to-pmtiles.yml b/.github/workflows/mbtiles-to-pmtiles.yml new file mode 100644 index 0000000..0382b7f --- /dev/null +++ b/.github/workflows/mbtiles-to-pmtiles.yml @@ -0,0 +1,46 @@ +name: Convert mbtiles to pmtiles + +on: + workflow_dispatch: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + env: + 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 binaries + run: sudo mkdir /mnt/output && sudo chown runner:docker /mnt/output && wget --progress=dot:giga https://github.com/protomaps/go-pmtiles/releases/download/v1.13.0/go-pmtiles_1.13.0_Linux_x86_64.tar.gz && tar xvf go-pmtiles* + + - 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: aws s3 cp s3://hikes-public/"$AREA".mbtiles . --endpoint-url=https://ce5627cfc65c8b54d40bb91c0ba7298b.r2.cloudflarestorage.com + + - name: pmtiles convert + run: pmtiles convert "$AREA".mbtiles /mnt/output/"$AREA".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/output/"$AREA".pmtiles s3://hikes-public/"$AREA".pmtiles diff --git a/.github/workflows/tile-join.yml b/.github/workflows/tile-join.yml index 8de6bed..1379e47 100644 --- a/.github/workflows/tile-join.yml +++ b/.github/workflows/tile-join.yml @@ -1,8 +1,7 @@ -name: Merge PMTiles into tiles.pmtiles +name: Merge multiple layers on: workflow_dispatch: - pull_request: jobs: build: @@ -35,8 +34,6 @@ jobs: run: aws s3 sync s3://hikes-public/layers/"$AREA"/ . --no-progress --endpoint-url=https://ce5627cfc65c8b54d40bb91c0ba7298b.r2.cloudflarestorage.com - name: tile-join - env: - TILEMAKER: /tmp/tilemaker run: /tmp/tile-join --no-tile-size-limit -o /mnt/output/tiles.mbtiles *.mbtiles - name: Upload tiles