From 3c650dc90cb84f84f7c60fa530ba86847a9c6ae7 Mon Sep 17 00:00:00 2001 From: Hidde Wieringa Date: Sun, 12 Jan 2025 16:12:41 +0100 Subject: [PATCH] deploy --- .github/workflows/deploy.yml | 44 ++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 11a1e34c..a6820566 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -88,13 +88,6 @@ jobs: - '36,35,37,70' - '37,35,38,70' - '38,35,39,70' - tiles: - - low-med - - high - - standard - - speed - - signals - - electrification steps: - name: Checkout @@ -110,29 +103,39 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Pull database + - name: Pull data run: | - docker compose pull db - docker compose up --no-build --pull never --wait db + docker pull ghcr.io/hiddewie/openrailwaymap-data:${{ matrix.bbox }} + CONTAINER_ID="$(docker container create ghcr.io/hiddewie/openrailwaymap-data:${{ matrix.bbox }})" + docker cp "$CONTAINER_ID:/data/data.osm.pbf" data/data.osm.pbf + docker container rm "$CONTAINER_ID" + + - name: Import data + run: | + docker compose run --build import import - name: Generate tiles env: - TILES: ${{ matrix.tiles }} BBOX: ${{ matrix.bbox }} run: | - docker compose run martin-cp - ls -lah tiles/*.mbtiles + for tile in low-med high standard speed signals electrification; do + docker compose run -e "TILES=$tile" -e BBOX martin-cp + done + + - name: List generated tiles + run: | + ls -lah tiles/split/${{ matrix.bbox }}/*.mbtiles - uses: actions/upload-artifact@v4 with: - name: tiles-${{ matrix.bbox }}-${{ matrix.tiles }} + name: tiles-${{ matrix.bbox }} path: | tiles/*.mbtiles if-no-files-found: error retention-days: 3 deploy-tiles: - name: Deploy tiles + name: Merge tiles runs-on: ubuntu-latest needs: generate-tiles environment: tiles-production @@ -160,6 +163,17 @@ jobs: path: tiles merge-multiple: true + - name: Merge tiles + env: + # for i in (seq -10 38); echo -n "$i,35,"(math $i + 1)",70 "; end + BBOXES: '-10,35,-9,70 -9,35,-8,70 -8,35,-7,70 -7,35,-6,70 -6,35,-5,70 -5,35,-4,70 -4,35,-3,70 -3,35,-2,70 -2,35,-1,70 -1,35,0,70 0,35,1,70 1,35,2,70 2,35,3,70 3,35,4,70 4,35,5,70 5,35,6,70 6,35,7,70 7,35,8,70 8,35,9,70 9,35,10,70 10,35,11,70 11,35,12,70 12,35,13,70 13,35,14,70 14,35,15,70 15,35,16,70 16,35,17,70 17,35,18,70 18,35,19,70 19,35,20,70 20,35,21,70 21,35,22,70 22,35,23,70 23,35,24,70 24,35,25,70 25,35,26,70 26,35,27,70 27,35,28,70 28,35,29,70 29,35,30,70 30,35,31,70 31,35,32,70 32,35,33,70 33,35,34,70 34,35,35,70 35,35,36,70 36,35,37,70 37,35,38,70 38,35,39,70' + run: | + docker compose run --entrypoint /tiles/merge.sh -e BBOXES martin-cp + + - name: Delete split tiles + run: | + rm -rf tiles/split + - name: List generated tiles run: | ls -lah tiles/*.mbtiles