2020-03-07 00:12:46 +02:00
|
|
|
name: Docker release
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
paths:
|
2022-08-26 10:52:36 +02:00
|
|
|
# Keep this in line with .dockerignore
|
2020-03-07 00:12:46 +02:00
|
|
|
- bin/scripts/docker-entrypoint.sh
|
2022-08-26 10:52:36 +02:00
|
|
|
- bin/scripts/name_parser/Fontname*.py
|
2020-03-07 00:12:46 +02:00
|
|
|
- src/glyphs/**
|
|
|
|
- .dockerignore
|
|
|
|
- Dockerfile
|
|
|
|
- font-patcher
|
2022-10-28 11:10:21 +02:00
|
|
|
workflow_dispatch:
|
2020-03-07 00:12:46 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish-image:
|
|
|
|
name: Publish image
|
|
|
|
runs-on: ubuntu-latest
|
2022-08-26 14:24:47 +02:00
|
|
|
if: ${{ github.repository_owner == 'ryanoasis' }}
|
2020-03-07 00:12:46 +02:00
|
|
|
steps:
|
2022-10-27 23:15:46 +02:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-06-02 11:14:09 +02:00
|
|
|
- name: Determine font-patcher version
|
|
|
|
id: patcher
|
|
|
|
run: |
|
|
|
|
ver_raw=$(grep "^\s*script_version\s*=\s*[\"'][0-9.]*[\"']" font-patcher)
|
|
|
|
echo "VERSION RAW ${ver_raw}"
|
|
|
|
ver=$(sed -E "s/.*[\"']([0-9.]+)[\"'].*/v\1/" <<< "$ver_raw")
|
|
|
|
echo "VERSION ${ver}"
|
|
|
|
echo "version=${ver}" >> $GITHUB_OUTPUT
|
|
|
|
|
2022-10-27 23:15:46 +02:00
|
|
|
# Docker Meta provides automatic, standard tagging
|
|
|
|
- name: Docker meta
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v4
|
|
|
|
with:
|
|
|
|
images: nerdfonts/patcher
|
2022-10-28 11:32:29 +02:00
|
|
|
flavor: latest=true
|
2023-06-02 11:14:09 +02:00
|
|
|
tags: |
|
|
|
|
type=semver,pattern={{version}},value={{ steps.patcher.outputs.version }}
|
2022-10-27 23:15:46 +02:00
|
|
|
|
|
|
|
# QEMU allows us to build container images for multiple architectures (amd64, ARM etc...)
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v2
|
2022-10-28 19:04:57 +02:00
|
|
|
with:
|
|
|
|
platforms: linux/amd64,linux/arm64
|
2022-10-27 23:15:46 +02:00
|
|
|
|
|
|
|
# Docker Buildx provides Buildkit support
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
with:
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USER }}
|
|
|
|
password: ${{ secrets.DOCKER_PAT }}
|
|
|
|
|
|
|
|
- name: Build and push
|
|
|
|
uses: docker/build-push-action@v3
|
|
|
|
with:
|
|
|
|
context: .
|
2022-10-28 19:04:57 +02:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2022-10-28 11:02:12 +02:00
|
|
|
push: true
|
2022-10-27 23:15:46 +02:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|