Update docker/build/action.yaml

This commit is contained in:
Zakary Timson 2023-11-24 03:13:26 +00:00
parent fabe032e66
commit 40a6a57e7e

View File

@ -1,24 +1,29 @@
name: Build docker image
inputs:
registry:
required: false
type: string
default: $GITHUB_SERVER_URL
image:
required: true
type: string
default: $GITHUB_REPOSITORY
tag:
required: false
type: string
runs:
using: composite
container: docker
steps:
- name: Build image
run: |
TAG=$([ -n "${{inputs.tag}}" ] && echo "${{inputs.tag}}" || [ "$GITHUB_REF" == "refs/heads/develop" ] && echo "latest" || echo "$GITHUB_REF_NAME" | sed -E "s/[_/]/-/g")
REG=$(echo "${{inputs.registry}}" | sed -E "s%https?://%%gi")
docker build --no-cache -t "$REG/${{inputs.image}}:$TAG" .
name: Docker Build
description: Build docker image
inputs:
registry:
type: string
required: false
default: ${{github.server_url}}
name:
type: string
required: false
default: ${{github.repository}}
tag:
type: string
required: false
default: ${{github.ref_name}}
dockerfile:
type: string
required: false
default: Dockerfile
runs:
using: composite
steps:
- name: Docker Login
uses: docker://docker
with:
entrypoint: docker
args: build -t "${{inputs.registry}}/${{inputs.name}}:${{inputs.tag}}" -f ${{inputs.dockerfile}} .