Update .github/workflows/docker.yaml

This commit is contained in:
Zakary Timson 2024-02-06 13:56:36 +00:00
parent c1fa83d47c
commit 9056c7c862

View File

@ -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}}