File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22name : Docker
33
44on :
5+ push :
6+ branches : [main]
7+ paths : [Dockerfile]
58 workflow_dispatch :
69 inputs :
710 ref :
@@ -34,11 +37,18 @@ jobs:
3437 uses : docker/setup-buildx-action@v4
3538
3639 - name : Log in to Docker Hub
40+ if : github.event_name != 'push'
3741 uses : docker/login-action@v4
3842 with :
3943 username : ${{ secrets.DOCKERHUB_USERNAME }}
4044 password : ${{ secrets.DOCKERHUB_TOKEN }}
4145
46+ # Build only (no push) to validate the Dockerfile on changes to main.
47+ - name : Setup vars (push)
48+ if : github.event_name == 'push'
49+ run : |
50+ echo "STELLAR_CLI_REF=${{ github.sha }}" >> $GITHUB_ENV
51+
4252 # Use the published tag as the ref; set both the versioned and `latest` tags.
4353 - name : Setup vars (release)
4454 if : github.event_name == 'release'
7888 with :
7989 context : .
8090 platforms : linux/amd64,linux/arm64
81- push : true
91+ push : ${{ github.event_name != 'push' }}
8292 build-args : STELLAR_CLI_REF=${{ env.STELLAR_CLI_REF }}
8393 tags : ${{ env.DOCKER_TAGS }}
You can’t perform that action at this time.
0 commit comments