Files
sniffnet/.github/workflows/docker.yml
dependabot[bot] 830cf68d89 Bump docker/build-push-action from 6 to 7
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6 to 7.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v6...v7)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-09 03:15:27 +00:00

50 lines
1.3 KiB
YAML

name: Docker
on:
workflow_dispatch:
jobs:
docker:
name: Docker Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Extract version from Cargo.toml
id: cargo-version
run: |
VERSION=v$(grep -m1 "^version" Cargo.toml | cut -d'"' -f2)
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@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: GyulyVGC
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v7
with:
context: .
platforms: linux/amd64
push: true
tags: |
ghcr.io/gyulyvgc/sniffnet:latest
ghcr.io/gyulyvgc/sniffnet:${{ env.VERSION }}