Skip to content

v0.0.17-test-action-4 #4

v0.0.17-test-action-4

v0.0.17-test-action-4 #4

name: Build and Push Docker Image for network/benchmarks/netperf/nptest
on:
push:
branches:
- master
release:
types: [published, edited]
jobs:
build-and-push:
permissions:
packages: write # Write permission is required to publish Docker images to GitHub Container Registry
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- 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 GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
run: |
cd network/benchmarks/netperf
make push
env:
DOCKERREPO: ghcr.io/${{ github.repository_owner }}/nptest
# IMAGE_TAG would be commit id if push else tag if release
IMAGE_TAG: ${{ github.event_name == 'push' && github.sha || github.event.release.tag_name }}