add meta and tags / platform
Some checks failed
Some checks failed
This commit is contained in:
parent
6cb0d053df
commit
21e8497b57
@ -12,6 +12,14 @@ on:
|
||||
image_name:
|
||||
required: true
|
||||
type: string
|
||||
file:
|
||||
required: false
|
||||
type: string
|
||||
default: 'Dockerfile'
|
||||
platforms:
|
||||
required: false
|
||||
type: string
|
||||
default: 'linux/amd64'
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
@ -40,15 +48,17 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
# image_name should be formatted like: user/repo
|
||||
images: ghcr.io/${{ inputs.image_name }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
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 }}
|
||||
|
||||
@ -12,6 +12,14 @@ on:
|
||||
image_name:
|
||||
required: true
|
||||
type: string
|
||||
file:
|
||||
required: false
|
||||
type: string
|
||||
default: 'Dockerfile'
|
||||
platforms:
|
||||
required: false
|
||||
type: string
|
||||
default: 'linux/amd64'
|
||||
secrets: []
|
||||
|
||||
jobs:
|
||||
@ -28,8 +36,18 @@ jobs:
|
||||
ref: ${{ inputs.ref }}
|
||||
token: ${{ github.token }}
|
||||
|
||||
- name: Build Docker image
|
||||
run: docker buildx build . -t 192.168.1.150:9120/${{ inputs.image_name }}:latest
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: 192.168.1.150:9120/${{ inputs.image_name }}
|
||||
|
||||
- name: Push Docker Image
|
||||
run: docker image push --all-tags 192.168.1.150:9120/${{ inputs.image_name }}
|
||||
- name: Build and push Docker image
|
||||
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 }}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user