Update docker/build/action.yaml
This commit is contained in:
parent
79d7b9986b
commit
540c913825
@ -1,40 +1,40 @@
|
|||||||
name: Docker Build
|
name: Docker Build
|
||||||
description: Build docker image
|
description: Build docker image
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
dockerfile:
|
dockerfile:
|
||||||
type: string
|
type: string
|
||||||
required: false
|
required: false
|
||||||
default: Dockerfile
|
default: Dockerfile
|
||||||
registry:
|
registry:
|
||||||
type: string
|
type: string
|
||||||
required: false
|
required: false
|
||||||
default: ${{github.server_url}}
|
default: ${{github.server_url}}
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
required: false
|
required: false
|
||||||
default: ${{github.repository}}
|
default: ${{github.repository}}
|
||||||
tag:
|
tag:
|
||||||
type: string
|
type: string
|
||||||
required: false
|
required: false
|
||||||
default: ${{github.ref_name}}
|
default: ${{github.ref_name}}
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: Creat Image Tag
|
- name: Creat Image Tag
|
||||||
run: echo "URL=$(echo ${{github.server_url}} | sed s%http://%% | sed s%https://%% )" >> $GITHUB_ENV
|
run: echo "URL=$(echo ${{github.server_url}} | sed s%http://%% | sed s%https://%% )" >> $GITHUB_ENV
|
||||||
shell: sh
|
shell: sh
|
||||||
|
|
||||||
- name: Docker Build
|
- name: Docker Build
|
||||||
uses: docker://docker
|
uses: docker://docker
|
||||||
with:
|
with:
|
||||||
entrypoint: docker
|
entrypoint: docker
|
||||||
args: build -t "${{env.URL}}/${{inputs.name}}:${{inputs.tag}}" -f ${{inputs.dockerfile}} .
|
args: build --pull -t "${{env.URL}}/${{inputs.name}}:${{inputs.tag}}" -f ${{inputs.dockerfile}} .
|
||||||
|
|
||||||
- name: Tag as Latest
|
- name: Tag as Latest
|
||||||
if: ${{inputs.tag}} != latest && ${{github.ref_name}} == (git symbolic-ref refs/remotes/origin/HEAD --short | cut -c 7)
|
if: ${{inputs.tag}} != latest && ${{github.ref_name}} == (git symbolic-ref refs/remotes/origin/HEAD --short | cut -c 7)
|
||||||
uses: docker://docker
|
uses: docker://docker
|
||||||
with:
|
with:
|
||||||
entrypoint: docker
|
entrypoint: docker
|
||||||
args: tag "${{env.URL}}/${{inputs.name}}:${{inputs.tag}}" "${{env.URL}}/${{inputs.name}}:latest"
|
args: tag "${{env.URL}}/${{inputs.name}}:${{inputs.tag}}" "${{env.URL}}/${{inputs.name}}:latest"
|
||||||
|
Loading…
Reference in New Issue
Block a user