Skip to content

Commit 844318b

Browse files
author
Sam Harrison
committed
fix: only do a Docker Login if the secrets are available
1 parent 9ca89c8 commit 844318b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/test-and-deploy.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,20 @@ jobs:
1717
timeout-minutes: 20
1818
strategy:
1919
matrix:
20-
java: [8, 11]
20+
java: [ 8, 11 ]
21+
env:
22+
DOCKER_LOGIN: ${{ secrets.DOCKER_USERNAME && secrets.DOCKER_AUTH_TOKEN }}
2123
steps:
2224
- name: Checkout sendgrid-java
2325
uses: actions/checkout@v2
2426

27+
- name: Login to Docker Hub
28+
if: env.DOCKER_LOGIN
29+
uses: docker/login-action@v1
30+
with:
31+
username: ${{ secrets.DOCKER_USERNAME }}
32+
password: ${{ secrets.DOCKER_AUTH_TOKEN }}
33+
2534
- name: Run Unit Tests
2635
run: make test-docker version=${{ matrix.java }}
2736

0 commit comments

Comments
 (0)