Skip to content

Commit

Permalink
test: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
JeppeKlitgaard committed Jan 6, 2023
1 parent 87cdc8b commit 5e6d57c
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build-font-builder-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

name: Create and publish a Docker image

on:
push:
branches: ['master', 'docker-build-*']
paths:
- helpers/docker/**

env:
REGISTRY: ghcr.io
REGISTRY_OWNER: jeppeklitgaard
IMAGE_NAME: font_builder

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.REGISTRY_OWNER }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: "helpers/docker"
file: "helpers/docker/font_builder.Dockerfile"
push: true
tags: ${{ env.REGISTRY }}/${{ env.REGISTRY_OWNER }}/${{ env.IMAGE_NAME }}
labels: ${{ steps.meta.outputs.labels }}
21 changes: 21 additions & 0 deletions helpers/docker/font_builder.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM python:3.11-slim-bullseye

LABEL org.opencontainers.image.url="https://openmoji.org/"
LABEL org.opencontainers.image.source="https:/hfg-gmuend/openmoji"
LABEL org.opencontainers.image.title="OpenMoji Font Builder"
LABEL org.opencontainers.image.description="Builds OpenMoji color fonts"

# This image is used to build fonts using nanoemoji and process them using woff2

# We need xmlstarlet
# We need GCC
# Remove pip git branch install and git dependency once https:/googlefonts/picosvg/pull/279 is merged
RUN apt update \
&& apt install -y --no-install-recommends xmlstarlet woff2 \
&& apt install -y --no-install-recommends git \
&& apt install -y --no-install-recommends gcc g++ \
&& rm -rf /var/lib/apt/lists/* \
&& pip install --no-cache-dir nanoemoji==0.15.0 \
&& pip install --no-cache-dir git+https:/JeppeKlitgaard/picosvg.git@fix-assert-line-length \
&& apt purge -y --auto-remove git \
&& apt purge -y --auto-remove gcc g++

0 comments on commit 5e6d57c

Please sign in to comment.