Build the image for PRs but do not push.
For pushes to main branch, push to registery.
Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
name: dev_container
on:
push:
+ branches:
+ - 'main'
+ pull_request:
branches:
- main
workflow_dispatch:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2
- name: Login to Quay.io
+ if: github.event_name == 'push' && github.ref_name == 'main'
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
with:
registry: quay.io
context: .
file: containers/teuthology-dev/Dockerfile
platforms: linux/amd64,linux/arm64
- push: true
+ push: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
tags: ${{ env.QUAY_URI }}:${{ env.QUAY_TAG }}
outputs: type=image,name=target