File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 17
17
permissions :
18
18
contents : read
19
19
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' }}
20
24
steps :
21
25
- uses : actions/checkout@v4
22
26
- uses : actions/setup-node@v4
96
100
IS_PR : ${{ github.event_name == 'pull_request' }}
97
101
# Try to log in early. If this fails, there's no reason to perform the remaining steps
98
102
- name : Log in to Docker Hub
103
+ # Only attempt to log in if we later attempt to push.
104
+ if : ${{ env.PUSH }}
99
105
uses : docker/login-action@v3
100
106
with :
101
107
username : ${{ secrets.DOCKER_HUB_USER }}
@@ -107,11 +113,7 @@ jobs:
107
113
with :
108
114
platforms : linux/amd64,linux/arm64
109
115
- name : Build and publish model-server Docker image
110
- uses : docker/build-push-action@v5
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' }}
116
+ uses : docker/build-push-action@v6
115
117
with :
116
118
context : ./model-server
117
119
file : ./model-server/Dockerfile
You can’t perform that action at this time.
0 commit comments