first commit
This commit is contained in:
53
action.yml
Normal file
53
action.yml
Normal file
@@ -0,0 +1,53 @@
|
||||
name: 'Build and Push Docker Image'
|
||||
description: 'Builds and pushes a Docker image to a registry using Docker Buildx'
|
||||
inputs:
|
||||
image_name:
|
||||
description: 'Full image name (including registry) used for caching references'
|
||||
required: true
|
||||
registry:
|
||||
description: 'Docker registry URL'
|
||||
required: true
|
||||
username:
|
||||
description: 'Registry username'
|
||||
required: true
|
||||
password:
|
||||
description: 'Registry password'
|
||||
required: true
|
||||
dockerfile:
|
||||
description: 'Path to the Dockerfile'
|
||||
required: false
|
||||
default: 'Dockerfile'
|
||||
context:
|
||||
description: 'Build context'
|
||||
required: false
|
||||
default: '.'
|
||||
push:
|
||||
description: 'Whether to push the image'
|
||||
required: false
|
||||
default: 'true'
|
||||
tags:
|
||||
description: 'List of tags (comma separated)'
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Set up Docker Buildx 🧰
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Registry 🔑
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ inputs.registry }}
|
||||
username: ${{ inputs.username }}
|
||||
password: ${{ inputs.password }}
|
||||
|
||||
- name: Build and push image 🏗️
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ${{ inputs.context }}
|
||||
file: ${{ inputs.dockerfile }}
|
||||
push: ${{ inputs.push }}
|
||||
tags: ${{ inputs.tags }}
|
||||
cache-from: type=registry,ref=${{ inputs.image_name }}:latest
|
||||
cache-to: type=inline
|
||||
Reference in New Issue
Block a user