-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (51 loc) · 2.49 KB
/
docker-generator.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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 }}