-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (42 loc) · 1.55 KB
/
build.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
name: "Build & deploy vector tiles"
on:
push:
branches: [ main ]
pull_request:
schedule:
- cron: '0 0 * * *'
env:
REGION: africa
AREA: rwanda
TILEMAKER_IMAGE: ghcr.io/jinigarashi/tilemaker:master
PMTILES_IMAGE: ghcr.io/protomaps/go-pmtiles:main
jobs:
tilemaker-build:
name: Generate vector tiles by tilemaker
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Download PBF file
run: |
mkdir data
curl -L http://download.geofabrik.de/${{ env.REGION }}/${{ env.AREA }}-latest.osm.pbf -o ./data/${{ env.AREA }}.osm.pbf
- name: pull docker image
run: |
docker pull ${{ env.TILEMAKER_IMAGE }}
docker pull ${{ env.PMTILES_IMAGE }}
- name: Build openmaptiles-compatible mbtiles files of given area
run: docker run -v $(pwd)/data:/srv ${{ env.TILEMAKER_IMAGE }} --input=/srv/${{ env.AREA }}.osm.pbf --output=/srv/${{ env.AREA }}.mbtiles
- name: Convert mbtiles to pmtiles
run: |
docker run -v $(pwd)/data:/srv ${{ env.PMTILES_IMAGE }} convert /srv/${{ env.AREA }}.mbtiles /srv/${{ env.AREA }}.pmtiles --tmpdir=/srv
- name: clean deploy folder
run: |
rm ./data/${{ env.AREA }}.osm.pbf
rm ./data/${{ env.AREA }}.mbtiles
- name: deploy to gh-pages
uses: JamesIves/[email protected]
if: ${{ github.ref == 'refs/heads/main' }}
with:
branch: gh-pages # The branch the action should deploy to.
folder: data # The folder the action should deploy.