From 441172fba98ac60f3f278dd26f9352cd020620f7 Mon Sep 17 00:00:00 2001 From: Daniel Milde Date: Thu, 15 Feb 2024 21:18:22 +0100 Subject: [PATCH] fix: workflow for docker with simplified meta --- .github/workflows/docker.yml | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 279108daa..9d1dd2b81 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,38 +1,40 @@ -name: Build and publish a Docker image +name: Docker on: + workflow_dispatch: push: - branches: ['master'] + branches: + - 'master' + tags: + - 'v*' env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} jobs: - build-and-push-image: + docker: runs-on: ubuntu-latest - permissions: - contents: read - packages: write steps: - - name: Checkout repository + - + name: Checkout uses: actions/checkout@v4 - - name: Log in to the Container registry - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + - + name: Login to registry + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker + - + name: Docker meta id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=semver,pattern={{version}} - type=sha - - name: Build and push Docker image - uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + - + name: Build and push + uses: docker/build-push-action@v5 with: context: . push: true