mirror of
https://github.com/GyulyVGC/sniffnet.git
synced 2026-08-04 14:51:37 +00:00
improve Docker CI/CD to exit if an image already exists for the current version
This commit is contained in:
parent
1e433ee1b9
commit
1cf21e6fc2
1 changed files with 7 additions and 4 deletions
11
.github/workflows/docker.yml
vendored
11
.github/workflows/docker.yml
vendored
|
|
@ -1,9 +1,6 @@
|
|||
name: Docker
|
||||
|
||||
on:
|
||||
# push:
|
||||
# tags:
|
||||
# - 'v[0-9]+.[0-9]+.[0-9]+'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
|
@ -21,6 +18,13 @@ jobs:
|
|||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Check there is no existing image with the same version
|
||||
run: |
|
||||
if docker manifest inspect ghcr.io/gyulyvgc/sniffnet:${{ env.VERSION }}; then
|
||||
echo "Image with version ${{ env.VERSION }} already exists"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
|
|
@ -43,4 +47,3 @@ jobs:
|
|||
tags: |
|
||||
ghcr.io/gyulyvgc/sniffnet:latest
|
||||
ghcr.io/gyulyvgc/sniffnet:${{ env.VERSION }}
|
||||
# ghcr.io/gyulyvgc/sniffnet:${{ github.ref_name }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue