Skip to content

Push Docker image

Push Docker image #60

name: Push Docker image
on:
release:
types: [published]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Get version
id: get-version
run: echo "VERSION=$(echo ${{ github.event.release.tag_name }} | cut -dv -f2)" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to Docker Hub
uses: docker/build-push-action@v5
with:
context: .
build-args: |
AUDITOR_VERSION=${{ steps.get-version.outputs.VERSION }}
platforms: linux/amd64,linux/arm64
push: true
tags: |
nbgrp/auditor:${{ steps.get-version.outputs.VERSION }}
nbgrp/auditor:latest