Skip to content

chore: Bump docker/setup-qemu-action from 1 to 3 #281

chore: Bump docker/setup-qemu-action from 1 to 3

chore: Bump docker/setup-qemu-action from 1 to 3 #281

Workflow file for this run

name: Build dev images
on:
push:
branches-ignore:
- 'release/**'
- 'develop'
pull_request:
branches-ignore:
- 'release/**'
types:
- opened
- reopened
- synchronize
- ready_for_review
permissions:
contents: read
packages: write
env:
DOCKER_IMAGE: ghcr.io/kereis/traefik-certs-dumper
LOCAL_DOCKER_IMAGE: localhost:5000/traefik-certs-dumper
jobs:
build-dev:
name: Build normal (Docker)
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Prepare tags for normal build
id: docker_meta
uses: docker/[email protected]
with:
images: ${{ env.DOCKER_IMAGE }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha
flavor: |
latest=false
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
driver-opts: network=host
- name: Cache Docker layers
uses: actions/[email protected]
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
if: ${{ github.event_name != 'pull_request' }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
uses: docker/build-push-action@v3
with:
builder: ${{ steps.buildx.outputs.name }}
platforms: linux/amd64,linux/arm64
context: .
file: ./docker/Dockerfile
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
push: true
- name: Build image (arm32v7)
uses: docker/build-push-action@v3
with:
builder: ${{ steps.buildx.outputs.name }}
platforms: linux/arm/v7
context: .
file: ./docker/Dockerfile.armhf
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
tags: ${{ env.LOCAL_DOCKER_IMAGE }}:armhf
labels: ${{ steps.docker_meta.outputs.labels }}
push: true
- name: Merge manifest and push
run: |
chmod +x tools/create_and_push_manifest.sh
echo "${{ steps.docker_meta.outputs.tags }}" "${{ env.DOCKER_IMAGE }}"
LABELS=$(echo -n "${{ steps.docker_meta.outputs.labels }}" | jq -R -s 'split("\n") | map(split("=")) | map({(.[0]): .[1]}) | add')
./tools/create_and_push_manifest.sh "${{ steps.docker_meta.outputs.tags }}" "${{ env.DOCKER_IMAGE }}" "${LABELS}"
build-dev-alpine:
name: Build Alpine
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Prepare tags for normal build
id: docker_meta
uses: docker/[email protected]
with:
images: ${{ env.DOCKER_IMAGE }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha
flavor: |
latest=false
suffix=-alpine
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/[email protected]
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
if: ${{ github.event_name != 'pull_request' }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
uses: docker/build-push-action@v3
with:
builder: ${{ steps.buildx.outputs.name }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
context: .
file: ./alpine/Dockerfile
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
push: true