-
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (45 loc) · 1.58 KB
/
deploy-tiles.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
name: 'Deploy Tiles'
on:
workflow_dispatch:
pull_request:
branches: [ "main" ]
paths:
- "deployment/**"
- ".github/workflows/deploy-tiles.yml"
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
env:
tofu_version: '1.7.1'
tg_version: '0.58.12'
working_dir: 'deployment'
jobs:
deploy:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
steps:
- name: 'Checkout'
uses: actions/checkout@main
- name: Find latest pmtiles build
id: latest_build
run: |
latest_build=$(curl -s https://build-metadata.protomaps.dev/builds.json | jq -r 'map(.key) | sort | last')
echo "KEY=$latest_build" >> $GITHUB_OUTPUT
- name: Setup Rclone
uses: AnimMouse/setup-rclone@v1
env:
RCLONE_CONFIG_R2_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_TILES_R2_KV_TOKEN_ID }}
RCLONE_CONFIG_R2_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_TILES_R2_KV_TOKEN_HASHED_VALUE }}
with:
disable_base64: true
rclone_config: |
[r2]
type = s3
provider = Cloudflare
region = auto
endpoint = https://601adaaa1eab190cdfe2945f9a6c89d0.r2.cloudflarestorage.com
[pmtiles]
type = http
url = https://build.protomaps.com/
- name: Copy latest tiles to R2
run: rclone --progress copyto pmtiles:/${{ steps.latest_build.outputs.KEY}} r2:/tiles/${{ steps.latest_build.outputs.KEY}} --s3-no-check-bucket --s3-chunk-size=256M --multi-thread-streams=25 --checkers=512