Skip to content

Update Github workflow #12

Update Github workflow

Update Github workflow #12

Workflow file for this run

name: ci
on:
push:
branches:
- '*'
tags:
- 'v*'
pull_request:
branches:
- $default-branch
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: geocat/activemq
jobs:
docker_image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
-
name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Transform GitHub Actions metadata to Docker image tags
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
labels: |
org.opencontainers.image.vendor=GeoCat B.V.
tags: |
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') || !startsWith(github.ref, 'refs/tags/0.') }}
type=raw,value={{branch}}-{{sha}},enable=${{ !startsWith(github.ref, 'refs/tags/') }}
-
name: Build image
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}