Skip to content

Commit

Permalink
Merge pull request #102 from govlt/docker-image-glyphs-and-sprites
Browse files Browse the repository at this point in the history
Docker image glyphs and sprites
  • Loading branch information
vycius authored May 10, 2024
2 parents 128f591 + 290ee2b commit bcbdf7f
Show file tree
Hide file tree
Showing 2,062 changed files with 81 additions and 6,094 deletions.
23 changes: 23 additions & 0 deletions .github/actions/build-pbf-glyphs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build pbf glyphs
description: Build pbf glyphs

inputs:
output-directory:
description: Required input set output directory
required: true

runs:
using: composite
steps:
- name: Restore Rust cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: pbf-glyphs

- name: Install build_pbf_glyphs
run: cargo install build_pbf_glyphs
shell: bash

- name: Build PBF glyphs
run: mkdir -p ${{ inputs.output-directory }} && build_pbf_glyphs vector/styles/fonts ${{ inputs.output-directory }}
shell: bash
31 changes: 31 additions & 0 deletions .github/actions/build-sprites/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build sprites
description: Build sprites

inputs:
output-directory:
description: Required input set output directory
required: true

runs:
using: composite
steps:
- name: Restore Rust cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: sprites

- name: Install spreet
run: cargo install spreet
shell: bash

- name: Build sprites
shell: bash
run: |
styles=("positron" "bright" "openmaptiles")
for style in "${styles[@]}"; do
mkdir -p ${{ inputs.output-directory }}/"$style"
spreet --unique --minify-index-file vector/styles/"$style"/sprites ${{ inputs.output-directory }}/"$style"
spreet --retina --unique --minify-index-file vector/styles/"$style"/sprites ${{ inputs.output-directory }}/"$style"@2x
done
17 changes: 15 additions & 2 deletions .github/workflows/reusable-workflow-publish-basemap-vector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ jobs:
ports:
- 3000:3000
steps:
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: vector-basemap-pmtiles
Expand All @@ -116,14 +119,24 @@ jobs:
run: curl http://localhost:3000/vector --create-dirs -o "tiles/tile.json" --compressed -s -S

- name: Change tiles url
run: jq '.tiles = ["'"${TILES}"'"]' tile.json > tile.json.tmp && mv tile.json.tmp tile.json
run: jq --compact-output '.tiles = ["'"${TILES}"'"]' tile.json > tile.json.tmp && mv tile.json.tmp tile.json
working-directory: tiles
env:
TILES: http://localhost:80/{z}/{x}/{y}.pbf

- name: Generate pbfs
run: tail -n +2 zxy.tsv | parallel --colsep '\t' curl "http://localhost:3000/vector/{1}/{2}/{3}" --create-dirs -s -S -o "tiles/{1}/{2}/{3}.pbf" --compressed

- name: Generate glyphs
uses: ./.github/actions/build-pbf-glyphs
with:
output-directory: tiles/font

- name: Generate sprites
uses: ./.github/actions/build-sprites
with:
output-directory: tiles/sprite

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -157,7 +170,7 @@ jobs:
destination-path: /tiles/vector/pbf

publish-basemap-vector-docker-image:
name: Vector static docker image build and push
name: Vector docker image build and push
runs-on: ubuntu-latest
timeout-minutes: 30
needs: generate-basemap-vector-pbf-tiles
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/reusable-workflow-publish-page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Restore Rust cache
uses: Swatinem/rust-cache@v2

- name: Install spreet
run: cargo install spreet

- name: Minify styles
run: find vector/styles -name "style.json" -print0 | xargs -0 -I{} sh -c 'jq -c . "{}" > tmp.json && mv tmp.json "{}"'

Expand Down Expand Up @@ -118,12 +112,18 @@ jobs:
cp -r vector/styles/"$style"/style.json output/styles/"$style"/style.json
cp -r vector/styles/"$style"/style-pmtiles.json output/styles/"$style"/style-pmtiles.json
cp -r vector/styles/"$style"/glyphs/. output/font
spreet --unique --minify-index-file vector/styles/"$style"/sprites output/sprite/"$style"
spreet --retina --unique --minify-index-file vector/styles/"$style"/sprites output/sprite/"$style"@2x
done
- name: Generate glyphs
uses: ./.github/actions/build-pbf-glyphs
with:
output-directory: output/font

- name: Generate sprites
uses: ./.github/actions/build-sprites
with:
output-directory: output/sprite

- name: Upload styles artifact
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion vector/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ WORKDIR /opt/vector
COPY --chown=$USER:$USER vector/docker/martin/config.yaml config.yaml

# Fonts
COPY --chown=$USER:$USER vector/styles/openmaptiles/fonts vector/styles/positron/fonts vector/styles/bright/fonts fonts/
COPY --chown=$USER:$USER vector/styles/fonts fonts/

# Sprites
COPY --chown=$USER:$USER vector/styles/openmaptiles/sprites styles/openmaptiles/sprites
Expand Down
2 changes: 1 addition & 1 deletion vector/preview/martin.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /opt/vector

COPY docker/martin/config.yaml config.yaml

COPY styles/openmaptiles/fonts styles/positron/fonts styles/bright/fonts fonts/
COPY styles/fonts fonts/

COPY styles/openmaptiles/sprites styles/openmaptiles/sprites
COPY styles/positron/sprites styles/positron/sprites
Expand Down
Binary file removed vector/styles/bright/glyphs/Noto Sans Bold/0-255.pbf
Binary file not shown.
3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/1024-1279.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/10240-10495.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/10496-10751.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/10752-11007.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/11008-11263.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/11264-11519.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/11520-11775.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/11776-12031.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/12032-12287.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/12288-12543.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/12544-12799.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/1280-1535.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/12800-13055.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/13056-13311.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/13312-13567.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/13568-13823.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/13824-14079.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/14080-14335.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/14336-14591.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/14592-14847.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/14848-15103.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/15104-15359.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/1536-1791.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/15360-15615.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/15616-15871.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/15872-16127.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/16128-16383.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/16384-16639.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/16640-16895.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/16896-17151.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/17152-17407.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/17408-17663.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/17664-17919.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/1792-2047.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/17920-18175.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/18176-18431.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/18432-18687.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/18688-18943.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/18944-19199.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/19200-19455.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/19456-19711.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/19712-19967.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/19968-20223.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/20224-20479.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/2048-2303.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/20480-20735.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/20736-20991.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/20992-21247.pbf

This file was deleted.

3 changes: 0 additions & 3 deletions vector/styles/bright/glyphs/Noto Sans Bold/21248-21503.pbf

This file was deleted.

Loading

0 comments on commit bcbdf7f

Please sign in to comment.