Update .github/workflows/docker.yaml
This commit is contained in:
parent
c1fa83d47c
commit
9056c7c862
19
.github/workflows/docker.yaml
vendored
19
.github/workflows/docker.yaml
vendored
@ -48,6 +48,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
url: ${{inputs.repository}}
|
url: ${{inputs.repository}}
|
||||||
|
|
||||||
|
- name: Get Version Number
|
||||||
|
run: [[ -f package.json ]] && echo "VERSION=$(cat package.json | grep version | grep -Eo ':.+' | grep -Eo '[[:alnum:]\.\/\-]+')" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build Docker Image
|
- name: Build Docker Image
|
||||||
uses: ztimson/actions/docker/build@develop
|
uses: ztimson/actions/docker/build@develop
|
||||||
with:
|
with:
|
||||||
@ -56,7 +59,7 @@ jobs:
|
|||||||
tag: ${{inputs.tag}}
|
tag: ${{inputs.tag}}
|
||||||
dockerfile: ${{inputs.dockerfile}}
|
dockerfile: ${{inputs.dockerfile}}
|
||||||
|
|
||||||
- name: Push Docker Image
|
- name: Push as ${{inputs.tag}}
|
||||||
uses: ztimson/actions/docker/push@develop
|
uses: ztimson/actions/docker/push@develop
|
||||||
with:
|
with:
|
||||||
registry: ${{inputs.registry}}
|
registry: ${{inputs.registry}}
|
||||||
@ -65,10 +68,22 @@ jobs:
|
|||||||
name: ${{inputs.name}}
|
name: ${{inputs.name}}
|
||||||
tag: ${{inputs.tag}}
|
tag: ${{inputs.tag}}
|
||||||
|
|
||||||
- name: Tag as Latest
|
- name: Push as ${{env.VERSION}}
|
||||||
|
uses: ztimson/actions/docker/push@develop
|
||||||
|
if: ${{env.VERSION}}
|
||||||
|
with:
|
||||||
|
from: "${{inputs.registry}}/${{inputs.name}}/${{inputs.tag}}"
|
||||||
|
registry: ${{inputs.registry}}
|
||||||
|
user: ${{inputs.user}}
|
||||||
|
pass: ${{inputs.pass}}
|
||||||
|
name: ${{inputs.name}}
|
||||||
|
tag: ${{env.VERSION}}
|
||||||
|
|
||||||
|
- name: Push as Latest
|
||||||
uses: ztimson/actions/docker/push@develop
|
uses: ztimson/actions/docker/push@develop
|
||||||
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)
|
||||||
with:
|
with:
|
||||||
|
from: "${{inputs.registry}}/${{inputs.name}}/${{inputs.tag}}"
|
||||||
registry: ${{inputs.registry}}
|
registry: ${{inputs.registry}}
|
||||||
user: ${{inputs.user}}
|
user: ${{inputs.user}}
|
||||||
pass: ${{inputs.pass}}
|
pass: ${{inputs.pass}}
|
||||||
|
Loading…
Reference in New Issue
Block a user