-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (58 loc) · 1.93 KB
/
Copy pathrefresh-data.yml
File metadata and controls
65 lines (58 loc) · 1.93 KB
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
55
56
57
58
59
60
61
62
63
64
65
name: Refresh map data
on:
schedule:
- cron: '0 4 * * 1'
workflow_dispatch:
jobs:
build-data:
runs-on: ubuntu-latest
steps:
- name: Download Berlin OSM extract
run: |
mkdir -p data/osm/berlin
curl -fSL -o data/osm/berlin/berlin.osm.pbf \
https://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
- name: Generate Berlin vector tiles
run: |
mkdir -p data/tiles
docker run --rm -v "$PWD/data/tiles:/output" versatiles/versatiles:latest \
convert \
--bbox "13.0,52.3,13.8,52.7" \
"https://download.versatiles.org/osm.versatiles" \
"/output/berlin.versatiles"
- name: Upload data artifacts
uses: actions/upload-artifact@v4
with:
name: map-data
path: |
data/osm/berlin/berlin.osm.pbf
data/tiles/berlin.versatiles
retention-days: 1
deploy-data:
needs: build-data
if: vars.DEPLOY_HOST != ''
runs-on: ubuntu-latest
steps:
- name: Download data artifacts
uses: actions/download-artifact@v4
with:
name: map-data
path: data
- name: Upload data to server
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ vars.DEPLOY_HOST }}
username: ${{ vars.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
source: "data/osm/berlin/berlin.osm.pbf,data/tiles/berlin.versatiles"
target: ~/beebeebike
- name: Restart services with new data
uses: appleboy/ssh-action@v1
with:
host: ${{ vars.DEPLOY_HOST }}
username: ${{ vars.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
script: |
cd ~/beebeebike
docker run --rm -v "$PWD/data/osm/berlin:/data" alpine rm -rf /data/graphhopper
docker compose -f compose.prod.yml restart graphhopper tiles