Skip to content

Commit

Permalink
Merge pull request #342 from brhahlen/docker-ci-improvements
Browse files Browse the repository at this point in the history
Update Docker CI
  • Loading branch information
KernelDeimos authored Apr 24, 2024
2 parents 548e975 + 028b37b commit e9e43c0
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/docker-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ name: Docker Image CI
# branch called `main`.
on:
push:
branches: ['release']

tags:
- '*.*.*'
# branches:
# - 'release'
pull_request:
branches:
- 'main'

# Defines two custom environment variables for the workflow. These are used
# for the Container registry domain, and a name for the Docker image that
Expand Down Expand Up @@ -40,8 +45,8 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
Expand All @@ -58,14 +63,8 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
type=sha
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
# This step uses the `docker/build-push-action` action to build the
# image, based on your repository's `Dockerfile`. If the build succeeds,
Expand All @@ -81,6 +80,8 @@ jobs:
with:
platforms: linux/amd64,linux/arm64
context: .
push: true
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit e9e43c0

Please sign in to comment.