File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1717 permissions :
1818 contents : read
1919 packages : write
20+ env :
21+ # We only push the resulting image when we are on release tag (i.e., the only time we have a push event) or on
22+ # manual request via the workflow_dispatch event.
23+ PUSH : ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
2024 steps :
2125 - uses : actions/checkout@v4
2226 - uses : actions/setup-node@v4
96100 IS_PR : ${{ github.event_name == 'pull_request' }}
97101 # Try to log in early. If this fails, there's no reason to perform the remaining steps
98102 - name : Log in to Docker Hub
103+ # Only attempt to log in if we later attempt to push.
104+ if : ${{ env.PUSH }}
99105 uses : docker/login-action@v3
100106 with :
101107 username : ${{ secrets.DOCKER_HUB_USER }}
@@ -108,10 +114,6 @@ jobs:
108114 platforms : linux/amd64,linux/arm64
109115 - name : Build and publish model-server Docker image
110116 uses : docker/build-push-action@v6
111- env :
112- # We only push the resulting image when we are on release tag (i.e., the only time we have a push event) or on
113- # manual request via the workflow_dispatch event.
114- PUSH : ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
115117 with :
116118 context : ./model-server
117119 file : ./model-server/Dockerfile
You can’t perform that action at this time.
0 commit comments