diff --git a/.github/workflows/docker-publish-nptest.yml b/.github/workflows/docker-publish-nptest.yml index f93f7a4dce..5d71aeeb2a 100644 --- a/.github/workflows/docker-publish-nptest.yml +++ b/.github/workflows/docker-publish-nptest.yml @@ -1,6 +1,9 @@ name: Build and Push Docker Image for network/benchmarks/netperf/nptest on: + push: + branches: + - master release: types: [published, edited] @@ -28,5 +31,8 @@ jobs: make push env: DOCKERREPO: ghcr.io/${{ github.repository_owner }}/nptest - # IMAGE_TAG should be commit id if push else tag if release - IMAGE_TAG: ${{ github.event.release.tag_name }} + # 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 }} + +permissions: + packages: write # Write permission is required to publish Docker images to GitHub Container Registry \ No newline at end of file