Skip to content

Commit c01c9c1

Browse files
committed
Simplify
1 parent 98df480 commit c01c9c1

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

.github/workflows/docker-publish.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,14 @@ jobs:
7878
steps:
7979
- name: Checkout
8080
uses: actions/checkout@v4
81-
- name: Set up environment variables for API key and Mapbox style
81+
- name: Set up environment variables
8282
run: |
83-
if [ "${{ matrix.apikey_secret }}" != "" ]; then
84-
echo "APIKEY=${{ secrets[matrix.apikey_secret] }}" >> $GITHUB_ENV
85-
fi
86-
if [ "${{ matrix.style }}" == "mapbox" ]; then
87-
echo "MAPBOX_STYLE=${{ secrets.MAPBOX_STYLE }}" >> $GITHUB_ENV
88-
fi
89-
- name: Test run of Docker image with ${{ matrix.style }} style
83+
[[ "${{ matrix.apikey_secret }}" ]] && echo "APIKEY=${{ secrets[matrix.apikey_secret] }}" >> $GITHUB_ENV
84+
[[ "${{ matrix.style }}" == "mapbox" ]] && echo "MAPBOX_STYLE=${{ secrets.MAPBOX_STYLE }}" >> $GITHUB_ENV
85+
- name: Test Docker image
9086
run: |
91-
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 || '' }}
92-
- name: Upload mbtiles artifacts
87+
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}
88+
- name: Upload mbtiles
9389
uses: actions/upload-artifact@v2
9490
with:
9591
name: mbtiles-${{ needs.build-and-deploy.outputs.version }}

0 commit comments

Comments
 (0)