Skip to content

Bump ubuntu from 2b7412e to 8eab65d in /images/toolbox (#22) #39

Bump ubuntu from 2b7412e to 8eab65d in /images/toolbox (#22)

Bump ubuntu from 2b7412e to 8eab65d in /images/toolbox (#22) #39

name: Build and push antrea/toolbox Docker image
on:
pull_request:
branches:
- main
paths:
- 'images/toolbox/**'
- '.github/workflows/docker_update_toolbox.yml'
push:
branches:
- main
paths:
- 'images/toolbox/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check-out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set docker tag
working-directory: images/toolbox
run: |
version=$(head -n 1 VERSION)
version_update_sha=$(git log -n 1 --pretty=format:%H -- VERSION)
rev=$(git rev-list --count ${version_update_sha}..HEAD -- .)
echo "version=${version}" >> $GITHUB_ENV
echo "rev=${rev}" >> $GITHUB_ENV
echo "docker_tag=${version}-${rev}" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: ${{ github.repository == 'antrea-io/image-utils' && github.event_name != 'pull_request' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: images/toolbox
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: ${{ github.repository == 'antrea-io/image-utils' && github.event_name != 'pull_request' }}
# first tag should be immutable, others are rolling tags
tags: antrea/toolbox:${{ env.docker_tag }},antrea/toolbox:${{ env.version }},antrea/toolbox:latest
no-cache: true