Skip to content

nightly-release

nightly-release #413

name: Tileset Generator using Docker
on:
# POST request to https://public.github.com/repos/technologiestiftung/qtrees-vectortiles-generator/dispatches with JSON body of { "event_type": "nightly-release", "client_payload": { "environment": "staging" } }
# environment is: staging or production
repository_dispatch:
types: [nightly-release]
jobs:
generator:
name: Generate the tileset
runs-on: ubuntu-latest
environment: ${{ github.event.client_payload.environment }}
steps:
- name: Log environment
run: |
echo "Environment: ${{ github.event.client_payload.environment }}"
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Run generator
env:
POSTGRES_HOST: ${{ secrets.POSTGRES_HOST }}
POSTGRES_DB: ${{ secrets.POSTGRES_DB }}
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
WORKDIR: "/usr/app"
TILESET_NAME: "trees.mbtiles"
TILESET_DIR: "/tilesets"
TMP_DIR: "/tmp"
# Changinng the name of the output file will
# will need a change in the frontend as well.
# See https://github.com/technologiestiftung/baumblick-frontend/blob/7768f5809d024197e26f0b96f55d7d8593a7f6f4/src/components/TreesMap/treesLayer.ts#L13
GEOJSON_OUTPUT_FILENAME: "trees.geo.json"
POSTGRES_MATERIALIZE_VIEW_NAME: "vector_tiles"
AWS_DEFAULT_REGION: eu-central-1
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
run: |
docker run --rm -v $PWD:$TMP_DIR -w $WORKDIR -e POSTGRES_HOST -e POSTGRES_DB -e POSTGRES_USER -e POSTGRES_PASSWORD -e TILESET_NAME -e TILESET_DIR -e TMP_DIR -e GEOJSON_OUTPUT_FILENAME -e POSTGRES_MATERIALIZE_VIEW_NAME -e AWS_DEFAULT_REGION -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_BUCKET technologiestiftung/qtrees-vectortiles_generator:2.6.2
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: tileset
path: trees.mbtiles
if-no-files-found: warn
- name: "run render webhook"
# if: github.event_name == 'release' && github.event.action == 'published'
run: |
curl -X POST ${{ secrets.RENDER_WEBHOOK_URL }}