Update docker/build/action.yaml
This commit is contained in:
parent
b50ceed2ae
commit
2093548721
@ -1,44 +0,0 @@
|
||||
name: Push docker image
|
||||
description: Build the local docker file & push to the registry
|
||||
|
||||
inputs:
|
||||
registry:
|
||||
required: false
|
||||
type: string
|
||||
default: $GITHUB_SERVER_URL
|
||||
registry_user:
|
||||
required: false
|
||||
type: string
|
||||
default: $GITHUB_ACTOR
|
||||
registry_pass:
|
||||
required: true
|
||||
type: string
|
||||
image:
|
||||
required: true
|
||||
type: string
|
||||
default: $GITHUB_REPOSITORY
|
||||
tag:
|
||||
required: false
|
||||
type: string
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Login to registry
|
||||
run: echo "${{inputs.registry_pass}}" | docker login -u "${{inputs.registry_user}}" --password-stdin "${{inputs.registry}}"
|
||||
|
||||
- name: Create tag
|
||||
run: TAG=$([ -n "${{inputs.tag}}" ] && echo "${{inputs.tag}}" || [ "$GITHUB_REF" == "refs/heads/develop" ] && echo "latest" || echo "$GITHUB_REF_NAME" | sed -E "s/[_/]/-/g") >> $GITHUB_ENV
|
||||
|
||||
- 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")
|
||||
docker build --no-cache -t "${{inputs.image}}:$TAG" .
|
||||
|
||||
- name: Push image
|
||||
run: |
|
||||
TAG=$([ -n "${{inputs.tag}}" ] && echo "${{inputs.tag}}" || [ "$GITHUB_REF" == "refs/heads/develop" ] && echo "latest" || echo "$GITHUB_REF_NAME" | sed -E "s/[_/]/-/g")
|
||||
docker push "${{inputs.image}}:$TAG"
|
19
docker/build/action.yaml
Normal file
19
docker/build/action.yaml
Normal file
@ -0,0 +1,19 @@
|
||||
name: Build docker image
|
||||
|
||||
inputs:
|
||||
image:
|
||||
required: true
|
||||
type: string
|
||||
default: $GITHUB_REPOSITORY
|
||||
tag:
|
||||
required: false
|
||||
type: string
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
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")
|
||||
docker build --no-cache -t "${{inputs.image}}:$TAG" .
|
Loading…
Reference in New Issue
Block a user