feat: Set labels when building docker image

pull/715/head
Gavin Mogan 2 years ago committed by GitHub
parent 92f75789fa
commit a1323cd516
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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 }}

@ -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:

@ -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

Loading…
Cancel
Save