From 65cecbc49aa9272f682372091a0d4e96b60056dc Mon Sep 17 00:00:00 2001 From: luandro Date: Sat, 17 Feb 2024 14:36:50 -0300 Subject: [PATCH 01/13] Create separate test job on action with matrix strategy --- .github/workflows/docker-publish.yml | 63 ++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 18 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index da207ba..2b9e9ed 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -13,6 +13,10 @@ on: jobs: docker: runs-on: ubuntu-latest + outputs: + tags: ${{ steps.meta.outputs.tags }} + version: ${{ steps.meta.outputs.version }} + image: ${{ steps.build_and_push.outputs.digest }} steps: - name: Checkout uses: actions/checkout@v4 @@ -31,6 +35,7 @@ jobs: with: images: communityfirst/mapgl-tile-renderer - name: Build and push Docker image + id: build_and_push uses: docker/build-push-action@v5 with: context: . @@ -47,28 +52,50 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} repository: communityfirst/mapgl-tile-renderer short-description: 'Node.js MapGL renderer for styled raster tiles in MBTiles format.' - - name: Test run of Docker image with self-provided style - run: | - docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ steps.meta.outputs.tags }} --style self --stylelocation tests/fixtures/alert/style-with-geojson.json --stylesources tests/fixtures/alert/sources --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z 10 -f self-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} - - name: Test run of Docker image with Bing source - run: | - docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ steps.meta.outputs.tags }} --style bing --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z 10 -f bing-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} - - name: Test run of Docker image with Esri source and GeoJSON overlay - run: | - docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ steps.meta.outputs.tags }} --style esri --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z 10 --overlay '{"type": "FeatureCollection", "name": "alert", "features": [{"geometry": {"coordinates": [[[-54.25348208981326, 3.140689896338671], [-54.25348208981326, 3.140600064810259], [-54.253841415926914, 3.140600064810259], [-54.25348208981326, 3.140689896338671]]], "geodesic": false, "type": "Polygon"}, "id": "-603946+34961", "properties": {"month_detec": "09", "year_detec": "2023"}, "type": "Feature"}]}' -f esri-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} - - name: Test run of Docker image with Mapbox source - run: | - docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ steps.meta.outputs.tags }} --style mapbox --mapboxstyle ${{ secrets.MAPBOX_STYLE }} --apikey ${{ secrets.MAPBOX_API_KEY }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z 10 -f mapbox-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} - - name: Test run of Docker image with Planet source - run: | - docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ steps.meta.outputs.tags }} --style planet --monthyear 2023-12 --apikey ${{ secrets.PLANET_API_KEY }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z 5 -f planet-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} - - name: Test run of Docker image with Protomaps source + test: + needs: docker + runs-on: ubuntu-latest + strategy: + matrix: + include: + - style: self + command: "--style self --stylelocation tests/fixtures/alert/style-with-geojson.json --stylesources tests/fixtures/alert/sources" + - style: bing + command: "--style bing" + - style: esri + command: "--style esri --overlay '{\"type\": \"FeatureCollection\", \"name\": \"alert\", \"features\": [{\"geometry\": {\"coordinates\": [[[-54.25348208981326, 3.140689896338671], [-54.25348208981326, 3.140600064810259], [-54.253841415926914, 3.140600064810259], [-54.25348208981326, 3.140689896338671]]], \"geodesic\": false, \"type\": \"Polygon\"}, \"id\": \"-603946+34961\", \"properties\": {\"month_detec\": \"09\", \"year_detec\": \"2023\"}, \"type\": \"Feature\"}]}'" + - style: mapbox + command: "--style mapbox --mapboxstyle mapbox-style-placeholder --apikey mapbox-api-key-placeholder" + - style: planet + command: "--style planet --monthyear 2013-12 --apikey planet-api-key-placeholder" + - style: + command: "--style protomaps --apikey protomaps-api-key-placeholder" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: docker-image + path: docker-image + - name: Display structure of downloaded files + run: ls -R + - name: Load Docker image + run: docker load < docker-image/image.tar + - name: Test run of Docker image with ${{ matrix.style }} style + env: + MAPBOX_STYLE: ${{ secrets.MAPBOX_STYLE }} + MAPBOX_API_KEY: ${{ secrets.MAPBOX_API_KEY }} + PLANET_API_KEY: ${{ secrets.PLANET_API_KEY }} + PROTOMAPS_API_KEY: ${{ secrets.PROTOMAPS_API_KEY }}" run: | - docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ steps.meta.outputs.tags }} --style protomaps --apikey ${{ secrets.PROTOMAPS_API_KEY }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z 5 -f protomaps-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} + docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ needs.docker.outputs.tags }} ${MATRIX_COMMAND} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z ${{ matrix.style == 'planet' && '5' || '10' }} -o ${{ matrix.style }}-${{ needs.docker.outputs.version }} - name: Upload mbtiles artifacts uses: actions/upload-artifact@v2 with: - name: mbtiles-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} + name: mbtiles-${{ needs.docker.outputs.version }} path: outputs/*.mbtiles if-no-files-found: error # 'warn' or 'ignore' are also available, 'error' will fail the step retention-days: ${{ github.event_name == 'release' && 90 || 15 }} From 3cabdf51061b8f84623c4e9675d372e585fa00db Mon Sep 17 00:00:00 2001 From: luandro Date: Thu, 1 Feb 2024 10:53:14 -0300 Subject: [PATCH 02/13] Remove unnecessary Docker image build and push steps --- .github/workflows/docker-publish.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 2b9e9ed..d1d6601 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -16,7 +16,6 @@ jobs: outputs: tags: ${{ steps.meta.outputs.tags }} version: ${{ steps.meta.outputs.version }} - image: ${{ steps.build_and_push.outputs.digest }} steps: - name: Checkout uses: actions/checkout@v4 @@ -35,7 +34,6 @@ jobs: with: images: communityfirst/mapgl-tile-renderer - name: Build and push Docker image - id: build_and_push uses: docker/build-push-action@v5 with: context: . @@ -73,17 +71,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Download artifact - uses: actions/download-artifact@v4 - with: - name: docker-image - path: docker-image - - name: Display structure of downloaded files - run: ls -R - - name: Load Docker image - run: docker load < docker-image/image.tar - name: Test run of Docker image with ${{ matrix.style }} style env: MAPBOX_STYLE: ${{ secrets.MAPBOX_STYLE }} From 1eb387d7b9cede6d8cbffc970947748f6493e641 Mon Sep 17 00:00:00 2001 From: luandro Date: Thu, 1 Feb 2024 10:59:00 -0300 Subject: [PATCH 03/13] Update docker-publish.yml to include -s option for matrix command --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index d1d6601..4407eff 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -78,7 +78,7 @@ jobs: PLANET_API_KEY: ${{ secrets.PLANET_API_KEY }} PROTOMAPS_API_KEY: ${{ secrets.PROTOMAPS_API_KEY }}" run: | - docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ needs.docker.outputs.tags }} ${MATRIX_COMMAND} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z ${{ matrix.style == 'planet' && '5' || '10' }} -o ${{ matrix.style }}-${{ needs.docker.outputs.version }} + docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ needs.docker.outputs.tags }} -s ${{ matrix.command }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z ${{ matrix.style == 'planet' && '5' || '10' }} -o ${{ matrix.style }}-${{ needs.docker.outputs.version }} - name: Upload mbtiles artifacts uses: actions/upload-artifact@v2 with: From e63738a283988e33e6d998a76849f5830b211465 Mon Sep 17 00:00:00 2001 From: luandro Date: Sat, 17 Feb 2024 14:50:51 -0300 Subject: [PATCH 04/13] Fix Docker command by removing -s --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 4407eff..a1a98a7 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -78,7 +78,7 @@ jobs: PLANET_API_KEY: ${{ secrets.PLANET_API_KEY }} PROTOMAPS_API_KEY: ${{ secrets.PROTOMAPS_API_KEY }}" run: | - docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ needs.docker.outputs.tags }} -s ${{ matrix.command }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z ${{ matrix.style == 'planet' && '5' || '10' }} -o ${{ matrix.style }}-${{ needs.docker.outputs.version }} + docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ needs.docker.outputs.tags }} ${{ matrix.command }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z ${{ matrix.style == 'planet' && '5' || '10' }} -o ${{ matrix.style }}-${{ needs.docker.outputs.version }} - name: Upload mbtiles artifacts uses: actions/upload-artifact@v2 with: From 671ea051c4aca899bf636c1bc37ee18320ad6e09 Mon Sep 17 00:00:00 2001 From: luandro Date: Sat, 17 Feb 2024 15:04:41 -0300 Subject: [PATCH 05/13] Use -f instead of -o for filename --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index a1a98a7..c78f001 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -78,7 +78,7 @@ jobs: PLANET_API_KEY: ${{ secrets.PLANET_API_KEY }} PROTOMAPS_API_KEY: ${{ secrets.PROTOMAPS_API_KEY }}" run: | - docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ needs.docker.outputs.tags }} ${{ matrix.command }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z ${{ matrix.style == 'planet' && '5' || '10' }} -o ${{ matrix.style }}-${{ needs.docker.outputs.version }} + docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ needs.docker.outputs.tags }} ${{ matrix.command }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z ${{ matrix.style == 'planet' && '5' || '10' }} -f ${{ matrix.style }}-${{ needs.docker.outputs.version }} - name: Upload mbtiles artifacts uses: actions/upload-artifact@v2 with: From 5f85ff7b260764b4847e6d661d586146c0c75e9b Mon Sep 17 00:00:00 2001 From: luandro Date: Sat, 17 Feb 2024 16:31:17 -0300 Subject: [PATCH 06/13] Use secrets --- .github/workflows/docker-publish.yml | 38 ++++++++++++++++++---------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index c78f001..7b082b9 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -11,7 +11,7 @@ on: types: [created] jobs: - docker: + build-and-deploy: runs-on: ubuntu-latest outputs: tags: ${{ steps.meta.outputs.tags }} @@ -50,39 +50,49 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} repository: communityfirst/mapgl-tile-renderer short-description: 'Node.js MapGL renderer for styled raster tiles in MBTiles format.' - test: - needs: docker + test-docker-image: + needs: build-and-deploy runs-on: ubuntu-latest strategy: matrix: + style: [self, bing, esri, mapbox, planet, protomaps] include: - style: self command: "--style self --stylelocation tests/fixtures/alert/style-with-geojson.json --stylesources tests/fixtures/alert/sources" + apikey_secret: "" - style: bing command: "--style bing" + apikey_secret: "" - style: esri command: "--style esri --overlay '{\"type\": \"FeatureCollection\", \"name\": \"alert\", \"features\": [{\"geometry\": {\"coordinates\": [[[-54.25348208981326, 3.140689896338671], [-54.25348208981326, 3.140600064810259], [-54.253841415926914, 3.140600064810259], [-54.25348208981326, 3.140689896338671]]], \"geodesic\": false, \"type\": \"Polygon\"}, \"id\": \"-603946+34961\", \"properties\": {\"month_detec\": \"09\", \"year_detec\": \"2023\"}, \"type\": \"Feature\"}]}'" + apikey_secret: "" - style: mapbox - command: "--style mapbox --mapboxstyle mapbox-style-placeholder --apikey mapbox-api-key-placeholder" + command: "--style mapbox" + apikey_secret: MAPBOX_API_KEY - style: planet - command: "--style planet --monthyear 2013-12 --apikey planet-api-key-placeholder" - - style: - command: "--style protomaps --apikey protomaps-api-key-placeholder" + command: "--style planet --monthyear 2013-12" + apikey_secret: PLANET_API_KEY + - style: protomaps + command: "--style protomaps" + apikey_secret: PROTOMAPS_API_KEY steps: - name: Checkout uses: actions/checkout@v4 + - name: Set up environment variables for API key and Mapbox style + run: | + if [ "${{ matrix.apikey_secret }}" != "" ]; then + echo "APIKEY=${{ secrets[matrix.apikey_secret] }}" >> $GITHUB_ENV + fi + if [ "${{ matrix.style }}" == "mapbox" ]; then + echo "MAPBOX_STYLE=${{ secrets.MAPBOX_STYLE }}" >> $GITHUB_ENV + fi - name: Test run of Docker image with ${{ matrix.style }} style - env: - MAPBOX_STYLE: ${{ secrets.MAPBOX_STYLE }} - MAPBOX_API_KEY: ${{ secrets.MAPBOX_API_KEY }} - PLANET_API_KEY: ${{ secrets.PLANET_API_KEY }} - PROTOMAPS_API_KEY: ${{ secrets.PROTOMAPS_API_KEY }}" run: | - docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ needs.docker.outputs.tags }} ${{ matrix.command }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z ${{ matrix.style == 'planet' && '5' || '10' }} -f ${{ matrix.style }}-${{ needs.docker.outputs.version }} + docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ needs.build-and-deploy.outputs.tags }} ${{ matrix.command }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z ${{ matrix.style == 'planet' && '5' || '10' }} -f ${{ matrix.style }}-${{ needs.build-and-deploy.outputs.version }} ${{ env.MAPBOX_STYLE && ' --mapboxstyle ' || '' }} ${{ env.MAPBOX_STYLE || '' }} ${{ env.APIKEY && ' --apikey ' || '' }} ${{ env.APIKEY || '' }} - name: Upload mbtiles artifacts uses: actions/upload-artifact@v2 with: - name: mbtiles-${{ needs.docker.outputs.version }} + name: mbtiles-${{ needs.build-and-deploy.outputs.version }} path: outputs/*.mbtiles if-no-files-found: error # 'warn' or 'ignore' are also available, 'error' will fail the step retention-days: ${{ github.event_name == 'release' && 90 || 15 }} From 50f7701d225f9a8f246af9231e07a48ecdd834bd Mon Sep 17 00:00:00 2001 From: luandro Date: Sat, 17 Feb 2024 16:38:56 -0300 Subject: [PATCH 07/13] Better spacing --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 7b082b9..f51483b 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -88,7 +88,7 @@ jobs: fi - name: Test run of Docker image with ${{ matrix.style }} style run: | - docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ needs.build-and-deploy.outputs.tags }} ${{ matrix.command }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z ${{ matrix.style == 'planet' && '5' || '10' }} -f ${{ matrix.style }}-${{ needs.build-and-deploy.outputs.version }} ${{ env.MAPBOX_STYLE && ' --mapboxstyle ' || '' }} ${{ env.MAPBOX_STYLE || '' }} ${{ env.APIKEY && ' --apikey ' || '' }} ${{ env.APIKEY || '' }} + docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ needs.build-and-deploy.outputs.tags }} ${{ matrix.command }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z ${{ matrix.style == 'planet' && '5' || '10' }} -f ${{ matrix.style }}-${{ needs.build-and-deploy.outputs.version }} ${{ env.MAPBOX_STYLE && '--mapboxstyle' || '' }} ${{ env.MAPBOX_STYLE || '' }} ${{ env.APIKEY && '--apikey' || '' }} ${{ env.APIKEY || '' }} - name: Upload mbtiles artifacts uses: actions/upload-artifact@v2 with: From 98df480dd72b6a2c70ed9187f0a89287fa4ba99e Mon Sep 17 00:00:00 2001 From: luandro Date: Sat, 17 Feb 2024 16:40:57 -0300 Subject: [PATCH 08/13] Remove git add from lint-staged --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index ab0e3c9..babcaed 100644 --- a/package.json +++ b/package.json @@ -44,8 +44,7 @@ }, "lint-staged": { "src/**/*.{js,jsx,ts,tsx,json,css}": [ - "prettier --write ./src", - "git add" + "prettier --write ./src" ] }, "repository": "https://github.com/conservationmetrics/mapgl-tile-renderer", From f81e0aea1320b0a1ff1358b23c8ae843bf1d86da Mon Sep 17 00:00:00 2001 From: luandro Date: Sat, 17 Feb 2024 17:03:58 -0300 Subject: [PATCH 09/13] Add rendering and screeshot of tiles --- .github/workflows/docker-publish.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index f51483b..b2b5779 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -89,10 +89,20 @@ jobs: - name: Test run of Docker image with ${{ matrix.style }} style run: | docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ needs.build-and-deploy.outputs.tags }} ${{ matrix.command }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z ${{ matrix.style == 'planet' && '5' || '10' }} -f ${{ matrix.style }}-${{ needs.build-and-deploy.outputs.version }} ${{ env.MAPBOX_STYLE && '--mapboxstyle' || '' }} ${{ env.MAPBOX_STYLE || '' }} ${{ env.APIKEY && '--apikey' || '' }} ${{ env.APIKEY || '' }} + - name: Install mbview + run: npm install -g @mapbox/mbview + - name: Render MBTiles using mbview + run: MAPBOX_ACCESS_TOKEN=${{ secrets.MAPBOX_API_KEY }} mbview --port 9000 outputs/*.mbtiles & + - name: Screenshot rendered tile + uses: swinton/screenshot-website@v1.x + with: + source: http://localhost:9000 + destination: ouputs/${{ matrix.style }}-${{ needs.build-and-deploy.outputs.version }}.png + full-page: true - name: Upload mbtiles artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: mbtiles-${{ needs.build-and-deploy.outputs.version }} - path: outputs/*.mbtiles + path: outputs/*.{mbtiles,png} if-no-files-found: error # 'warn' or 'ignore' are also available, 'error' will fail the step retention-days: ${{ github.event_name == 'release' && 90 || 15 }} From 913a7cef831191aec634e3dcff36448c179a55d4 Mon Sep 17 00:00:00 2001 From: luandro Date: Sat, 17 Feb 2024 17:10:24 -0300 Subject: [PATCH 10/13] Add setup-node --- .github/workflows/docker-publish.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index b2b5779..72d6dc6 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -89,6 +89,9 @@ jobs: - name: Test run of Docker image with ${{ matrix.style }} style run: | docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ needs.build-and-deploy.outputs.tags }} ${{ matrix.command }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z ${{ matrix.style == 'planet' && '5' || '10' }} -f ${{ matrix.style }}-${{ needs.build-and-deploy.outputs.version }} ${{ env.MAPBOX_STYLE && '--mapboxstyle' || '' }} ${{ env.MAPBOX_STYLE || '' }} ${{ env.APIKEY && '--apikey' || '' }} ${{ env.APIKEY || '' }} + - uses: actions/setup-node@v4 + with: + node-version: 20 - name: Install mbview run: npm install -g @mapbox/mbview - name: Render MBTiles using mbview From 34cfd70508d40b3aaec7f3370607f3cb8211a14f Mon Sep 17 00:00:00 2001 From: luandro Date: Sat, 17 Feb 2024 17:28:54 -0300 Subject: [PATCH 11/13] Simplify --- .github/workflows/docker-publish.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 72d6dc6..df15962 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -92,10 +92,11 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 20 - - name: Install mbview - run: npm install -g @mapbox/mbview - - name: Render MBTiles using mbview - run: MAPBOX_ACCESS_TOKEN=${{ secrets.MAPBOX_API_KEY }} mbview --port 9000 outputs/*.mbtiles & + - name: Install mbview and render tiles + run: | + npm install -g @mapbox/mbview + MAPBOX_ACCESS_TOKEN=${{ secrets.MAPBOX_API_KEY }} mbview --port 9000 outputs/*.mbtiles & + sleep 10 - name: Screenshot rendered tile uses: swinton/screenshot-website@v1.x with: From 4390776ef38eb0914a4e5b3a40d06bfee753b015 Mon Sep 17 00:00:00 2001 From: luandro Date: Sat, 17 Feb 2024 17:48:13 -0300 Subject: [PATCH 12/13] Add timeout remove setup-node --- .github/workflows/docker-publish.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index df15962..c4c69cb 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -53,6 +53,7 @@ jobs: test-docker-image: needs: build-and-deploy runs-on: ubuntu-latest + timeout-minutes: 30 strategy: matrix: style: [self, bing, esri, mapbox, planet, protomaps] @@ -89,9 +90,6 @@ jobs: - name: Test run of Docker image with ${{ matrix.style }} style run: | docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ needs.build-and-deploy.outputs.tags }} ${{ matrix.command }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z ${{ matrix.style == 'planet' && '5' || '10' }} -f ${{ matrix.style }}-${{ needs.build-and-deploy.outputs.version }} ${{ env.MAPBOX_STYLE && '--mapboxstyle' || '' }} ${{ env.MAPBOX_STYLE || '' }} ${{ env.APIKEY && '--apikey' || '' }} ${{ env.APIKEY || '' }} - - uses: actions/setup-node@v4 - with: - node-version: 20 - name: Install mbview and render tiles run: | npm install -g @mapbox/mbview From 238a093ea074e8fd23dfa8f8f49d2c464cd36120 Mon Sep 17 00:00:00 2001 From: luandro Date: Sat, 17 Feb 2024 18:00:53 -0300 Subject: [PATCH 13/13] Add fail-fast strategy --- .github/workflows/docker-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index c4c69cb..35d117e 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -55,6 +55,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 strategy: + fail-fast: true matrix: style: [self, bing, esri, mapbox, planet, protomaps] include: