Add on push to trigger it once #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build & Push the Python Builder Image | |
| on: | |
| push: | |
| workflow_dispatch: | |
| inputs: | |
| docker-tag: | |
| description: 'Docker tag for push (e.g. 2.0.0)' | |
| required: true | |
| env: | |
| GOLANG_VERSION: 1.24.7 | |
| jobs: | |
| operator: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v3 | |
| with: | |
| go-version: ${{ env.GOLANG_VERSION }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Set default docker tag for builds from master | |
| id: docker-tag | |
| run: | | |
| USER_INPUT="${{ github.event.inputs.docker-tag }}" | |
| echo "value=${USER_INPUT:-latest}" >> $GITHUB_OUTPUT | |
| - name: Build and push | |
| working-directory: ./python-builder/ | |
| run: | | |
| make DOCKER_IMAGE_VERSION=${{ steps.docker-tag.outputs.value }} build_docker_image | |
| make DOCKER_IMAGE_VERSION=${{ steps.docker-tag.outputs.value }} push_to_registry |