Publish Docker images #1029
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Docker images | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
schedule: | |
- cron: '0 3 * * *' | |
pull_request: | |
env: | |
VIPS_VERSION: v8.16.0 | |
LIBJXL_VERSION: latest | |
# LIBJXL_VERSION: v0.10.3 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
# tag-snapshot: | |
# name: Add a tag to satisfy stupid action runner | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Tag commit | |
# uses: tvdias/[email protected] | |
# with: | |
# repo-token: "${{ secrets.GITHUB_TOKEN }}" | |
# tag: "latest" | |
push_to_registry: | |
name: Push Docker image to GitHub Packages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Login to GitHub Packages Docker Registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
logout: false | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Push to GitHub Packages | |
uses: docker/[email protected] | |
with: | |
push: true | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
tags: | | |
ghcr.io/cmahnke/iiif-action:latest | |
build_uploader: | |
name: Push uploader Docker image to GitHub Packages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Login to GitHub Packages Docker Registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
logout: false | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Push to GitHub Packages | |
uses: docker/[email protected] | |
with: | |
build-args: ADDITIONAL_DEPS=parallel rsync sshpass bash findutils | |
push: true | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
tags: | | |
ghcr.io/cmahnke/iiif-action:latest-uploader | |
build_jxl: | |
name: Push JPEG XL Docker image to GitHub Packages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Login to GitHub Packages Docker Registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
logout: false | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Change base image | |
run: | | |
sed -i -e 's/alpine:3.21/ghcr.io\/cmahnke\/jpeg-xl-action:${{ env.LIBJXL_VERSION }}/g' Dockerfile | |
cat Dockerfile | |
- name: Push to GitHub Packages | |
uses: docker/[email protected] | |
with: | |
context: . | |
build-args: GIT_TAG=${{ env.VIPS_VERSION }} | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
push: true | |
tags: | | |
ghcr.io/cmahnke/iiif-action:latest-jxl | |
ghcr.io/cmahnke/iiif-action:${{ env.VIPS_VERSION }}-jxl | |
ghcr.io/cmahnke/iiif-action:${{ env.VIPS_VERSION }}-jxl-${{ env.LIBJXL_VERSION }} | |
build_jxl_uploader: | |
name: Push JPEG XL Uploader Docker image to GitHub Packages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Login to GitHub Packages Docker Registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
logout: false | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Change base image | |
run: | | |
sed -i -e 's/alpine:3.21/ghcr.io\/cmahnke\/jpeg-xl-action:${{ env.LIBJXL_VERSION }}/g' Dockerfile | |
cat Dockerfile | |
- name: Push to GitHub Packages | |
uses: docker/[email protected] | |
with: | |
context: . | |
build-args: | | |
GIT_TAG=${{ env.VIPS_VERSION }} | |
ADDITIONAL_DEPS=parallel rsync sshpass bash findutils | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
push: true | |
tags: | | |
ghcr.io/cmahnke/iiif-action:latest-jxl-uploader | |
ghcr.io/cmahnke/iiif-action:${{ env.VIPS_VERSION }}-jxl-uploader | |
ghcr.io/cmahnke/iiif-action:${{ env.VIPS_VERSION }}-jxl-${{ env.LIBJXL_VERSION }}-uploader | |
test: | |
name: Test the build Docker image | |
needs: push_to_registry | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Login to GitHub Packages Docker Registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
logout: false | |
# - name: Create IIIF derivates | |
# uses: docker://ghcr.io/cmahnke/iiif-action:latest | |
# with: | |
# args: 'vips dzsave test/2010_02-March-April_Whaling_01.jpg test/ -t 512 --layout iiif --id ''.''' | |
- name: Create IIIF derivates | |
run: docker run -v ${PWD}:${PWD} ghcr.io/cmahnke/iiif-action:latest sh -c "vips dzsave ${PWD}/test/2010_02-March-April_Whaling_01.jpg ${PWD}/test/ --tile-size=512 --layout iiif --id '.'" | |
- name: List results | |
run: | | |
ls test | |
ls test/test | |
test-jxl: | |
name: Test if VIPS was build with JXL support | |
needs: build_jxl | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Login to GitHub Packages Docker Registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
logout: false | |
- name: Get VIPS config | |
run: docker run -v ${PWD}:${PWD} ghcr.io/cmahnke/iiif-action:latest-jxl sh -c "vips --vips-config" > vips-config.txt | |
- name: Check Config | |
run: | | |
grep JXL vips-config.txt |grep true | |
cat vips-config.txt | |
test-jxl-uploader: | |
name: Test if VIPS was build with JXL support | |
needs: build_jxl_uploader | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Login to GitHub Packages Docker Registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
logout: false | |
- name: Get VIPS config | |
run: docker run -v ${PWD}:${PWD} ghcr.io/cmahnke/iiif-action:latest-jxl-uploader sh -c "vips --vips-config" > vips-config.txt | |
- name: Check Config | |
run: | | |
grep JXL vips-config.txt |grep true | |
cat vips-config.txt |