mirror of
https://github.com/GyulyVGC/sniffnet.git
synced 2025-12-23 22:29:01 -05:00
improve Docker CI/CD to exit if an image already exists for the current version
This commit is contained in:
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 }}
|
||||
|
||||
Reference in New Issue
Block a user