8000 [pull] master from tdewolff:master by pull[bot] · Pull Request #276 · kokizzu/minify · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 93 additions & 19 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,101 @@
name: Docker

on:
push:
tags:
- 'v*'
- 'v*'

env:
IMAGE_NAME: tdewolff/minify

jobs:
build:
name: Build ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
include:
- platform: linux/amd64
runner: ubuntu-latest
platform_pair: linux-amd64
- platform: linux/arm64
runner: ubuntu-24.04-arm
platform_pair: linux-arm64

runs-on: ${{ matrix.runner }}

steps:
- uses: actions/checkout@v6

- uses: docker/metadata-action@v6
id: meta
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=ref,event=tag

- uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- uses: docker/setup-buildx-action@v4

- uses: docker/build-push-action@v7
id: build
with:
context: .
file: ./Dockerfile
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true

- name: Export digest
run: |
mkdir -p "${{ runner.temp }}/digests"
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${digest#sha256:}"

- uses: actions/upload-artifact@v4
with:
name: digests-${{ matrix.platform_pair }}
path: ${{ runner.temp }}/digests/*
if-no-files-found: error
retention-days: 1

merge:
name: Merge manifests
runs-on: ubuntu-latest
needs: build

steps:
- uses: actions/checkout@v6
- uses: docker/metadata-action@v6
id: meta
with:
images: tdewolff/minify
tags: type=ref,event=tag
- uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- uses: docker/setup-buildx-action@v4
- uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- uses: actions/download-artifact@v4
with:
path: ${{ runner.temp }}/digests
pattern: digests-*
merge-multiple: true

- uses: docker/metadata-action@v6
id: meta
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=ref,event=tag

- uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- uses: docker/setup-buildx-action@v4

- name: Create manifest list
working-directory: ${{ runner.temp }}/digests
run: |
docker buildx imagetools create \
$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *)

- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use this image to build the executable
FROM golang:1.24-alpine AS build
FROM golang:1.25-alpine AS build

WORKDIR /go/src/github.com/tdewolff/minify
COPY . /go/src/github.com/tdewolff/minify/
Expand Down
Loading
0