Skip to content

Commit 707ade9

Browse files
gate CI push on DEPLOY_ENABLED; build-only when flag is off
1 parent 093cf3e commit 707ade9

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ jobs:
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

0 commit comments

Comments
 (0)