Skip to content

Commit 4917049

Browse files
committed
Make docker-build and deploy jobs conditional on secrets being configured
1 parent 17a6cfa commit 4917049

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ jobs:
9696
docker-build:
9797
needs: [build-and-test, build-web]
9898
runs-on: ubuntu-latest
99-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
99+
# Only run if on main branch AND secrets are configured
100+
if: github.ref == 'refs/heads/main' && github.event_name == 'push' && vars.ACR_LOGIN_SERVER != ''
100101

101102
permissions:
102103
contents: read
@@ -164,7 +165,8 @@ jobs:
164165
deploy:
165166
needs: docker-build
166167
runs-on: ubuntu-latest
167-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
168+
# Only run if docker-build succeeded (not skipped)
169+
if: needs.docker-build.result == 'success'
168170
environment: production
169171

170172
permissions:

0 commit comments

Comments
 (0)