Skip to content

Commit 4726253

Browse files
author
Sam Harrison
committed
fix: only do a Docker Login if the secrets are available
1 parent fe77ee9 commit 4726253

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,21 @@ jobs:
1515
name: Test
1616
runs-on: ubuntu-latest
1717
timeout-minutes: 20
18+
env:
19+
DOCKER_LOGIN: ${{ secrets.DOCKER_USERNAME && secrets.DOCKER_AUTH_TOKEN }}
1820
steps:
1921
- name: Checkout sendgrid-csharp
2022
uses: actions/checkout@v2
2123
with:
2224
fetch-depth: 0
2325

26+
- name: Login to Docker Hub
27+
if: env.DOCKER_LOGIN
28+
uses: docker/login-action@v1
29+
with:
30+
username: ${{ secrets.DOCKER_USERNAME }}
31+
password: ${{ secrets.DOCKER_AUTH_TOKEN }}
32+
2433
- name: Setup .NET Core SDK
2534
uses: actions/[email protected]
2635
with:

0 commit comments

Comments
 (0)