add meta and tags / platform
Some checks failed
Reload Act Runner Stack to clear cache for workflows / diff (push) Successful in 1m26s
Reload Act Runner Stack to clear cache for workflows / deploy-gitainer (push) Failing after 4s
Reload Act Runner Stack to clear cache for workflows / notify (push) Has been skipped

This commit is contained in:
Martin Dimitrov 2026-03-06 11:52:17 -08:00
parent 6cb0d053df
commit 21e8497b57
2 changed files with 34 additions and 6 deletions

View File

@ -12,6 +12,14 @@ on:
image_name: image_name:
required: true required: true
type: string type: string
file:
required: false
type: string
default: 'Dockerfile'
platforms:
required: false
type: string
default: 'linux/amd64'
jobs: jobs:
docker: docker:
@ -40,15 +48,17 @@ jobs:
- name: Extract metadata (tags, labels) for Docker - name: Extract metadata (tags, labels) for Docker
id: meta id: meta
uses: docker/metadata-action@v5 uses: docker/metadata-action@v6
with: with:
# image_name should be formatted like: user/repo # image_name should be formatted like: user/repo
images: ghcr.io/${{ inputs.image_name }} images: ghcr.io/${{ inputs.image_name }}
- name: Build and push Docker image - name: Build and push Docker image
uses: docker/build-push-action@v5 uses: docker/build-push-action@v6
with: with:
context: . context: .
file: ${{ inputs.file }}
platforms: ${{ inputs.platforms }}
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}

View File

@ -12,6 +12,14 @@ on:
image_name: image_name:
required: true required: true
type: string type: string
file:
required: false
type: string
default: 'Dockerfile'
platforms:
required: false
type: string
default: 'linux/amd64'
secrets: [] secrets: []
jobs: jobs:
@ -28,8 +36,18 @@ jobs:
ref: ${{ inputs.ref }} ref: ${{ inputs.ref }}
token: ${{ github.token }} token: ${{ github.token }}
- name: Build Docker image - name: Extract metadata (tags, labels) for Docker
run: docker buildx build . -t 192.168.1.150:9120/${{ inputs.image_name }}:latest id: meta
uses: docker/metadata-action@v6
with:
images: 192.168.1.150:9120/${{ inputs.image_name }}
- name: Push Docker Image - name: Build and push Docker image
run: docker image push --all-tags 192.168.1.150:9120/${{ inputs.image_name }} uses: docker/build-push-action@v6
with:
context: .
file: ${{ inputs.file }}
platforms: ${{ inputs.platforms }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}