File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212
1313 - uses : docker/setup-buildx-action@v4
1414
15+ # Login + push only happen when DEPLOY_ENABLED=true.
16+ # Otherwise the job builds the images locally to validate the
17+ # Dockerfiles and exits green — a "dry run."
1518 - uses : docker/login-action@v4
19+ if : ${{ vars.DEPLOY_ENABLED == 'true' }}
1620 with :
1721 username : ${{ secrets.DOCKERHUB_USERNAME }}
1822 password : ${{ secrets.DOCKERHUB_TOKEN }}
@@ -21,17 +25,13 @@ jobs:
2125 uses : docker/build-push-action@v7
2226 with :
2327 context : ./backend
24- push : true
25- tags : |
26-
27- ${{ secrets.DOCKERHUB_USERNAME }}/skillpulse-backend:latest
28+ push : ${{ vars.DEPLOY_ENABLED == 'true' }}
29+ tags : ${{ secrets.DOCKERHUB_USERNAME != '' && format('{0}/skillpulse-backend:latest', secrets.DOCKERHUB_USERNAME) || 'skillpulse-backend:latest' }}
2830
2931 - name : Build and push frontend
3032 uses : docker/build-push-action@v7
3133 with :
3234 context : ./frontend
33- push : true
34- tags : |
35-
36- ${{ secrets.DOCKERHUB_USERNAME }}/skillpulse-frontend:latest
35+ push : ${{ vars.DEPLOY_ENABLED == 'true' }}
36+ tags : ${{ secrets.DOCKERHUB_USERNAME != '' && format('{0}/skillpulse-frontend:latest', secrets.DOCKERHUB_USERNAME) || 'skillpulse-frontend:latest' }}
3737
You can’t perform that action at this time.
0 commit comments