actions/docker/build/action.yaml

25 lines
642 B
YAML
Raw Normal View History

2023-07-28 13:57:50 -04:00
name: Build docker image
inputs:
2023-07-28 14:10:03 -04:00
registry:
required: false
type: string
default: $GITHUB_SERVER_URL
2023-07-28 13:57:50 -04:00
image:
required: true
type: string
default: $GITHUB_REPOSITORY
tag:
required: false
type: string
runs:
using: composite
2023-08-07 10:01:21 -04:00
container: docker
2023-07-28 13:57:50 -04:00
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")
2023-07-28 15:10:04 -04:00
REG=$(echo "${{inputs.registry}}" | sed -E "s%https?://%%gi")
2023-07-28 15:08:33 -04:00
docker build --no-cache -t "$REG/${{inputs.image}}:$TAG" .