Skip to content

Merge pull request #68 from Mellanox/dependabot/github_actions/docker… #63

Merge pull request #68 from Mellanox/dependabot/github_actions/docker…

Merge pull request #68 from Mellanox/dependabot/github_actions/docker… #63

name: "Image push main"
on:
push:
branches:
- main
jobs:
image-build-push:
name: Image build and push
runs-on: ubuntu-latest
steps:
- name: Set repository as lower-case output variable
id: repo_name
run: echo ::set-output name=repository::$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ steps.repo_name.outputs.repository }}
- name: Build and push container image
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ steps.repo_name.outputs.repository }}:latest
labels: ${{ steps.docker_meta.outputs.labels }}
file: ./Dockerfile