1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-18 20:59:44 +02:00

feat: Set labels when building docker image

This commit is contained in:
Gavin Mogan 2024-04-15 07:19:53 -07:00 committed by GitHub
parent a69270eeef
commit 8ef27ca32a
3 changed files with 17 additions and 6 deletions

View file

@ -40,5 +40,5 @@ jobs:
build-args: ALPINE_VERSION=${{ env.ALPINE_VERSION }} build-args: ALPINE_VERSION=${{ env.ALPINE_VERSION }}
push: true push: true
tags: | tags: |
ghcr.io/plankanban/planka:base-latest ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:base-latest
ghcr.io/plankanban/planka:base-${{ env.ALPINE_VERSION }} ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:base-${{ env.ALPINE_VERSION }}

View file

@ -11,7 +11,7 @@ on:
branches: [master] branches: [master]
env: env:
REGISTRY_IMAGE: ghcr.io/plankanban/planka REGISTRY_IMAGE: ghcr.io/${{ github.repository_owner }}/${{ github.repository }}
jobs: jobs:
build: build:

View file

@ -31,12 +31,23 @@ jobs:
result-encoding: string result-encoding: string
script: return context.payload.release.tag_name.replace('v', '') script: return context.payload.release.tag_name.replace('v', '')
- name: Generate docker image tags
id: metadata
uses: docker/metadata-action@v5
with:
images: |
name=ghcr.io/${{ github.repository_owner }}/${{ github.repository }}
tags: |
type=raw,value=${{ steps.set-version.outputs.result }}
type=raw,value=latest
- name: Build and push - name: Build and push
uses: docker/build-push-action@v4 uses: docker/build-push-action@v4
with: with:
context: . context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7 platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true push: true
tags: | tags: ${{ steps.metadata.outputs.tags }}
ghcr.io/plankanban/planka:latest labels: ${{ steps.metadata.outputs.labels }}
ghcr.io/plankanban/planka:${{ steps.set-version.outputs.result }} cache-from: type=gha
cache-to: type=gha,mode=max