Skip to content

Commit 98f0071

Browse files
Sam Harrisonbdarcet
authored andcommitted
fix: only do a Docker Login if the secrets are available
1 parent 2498455 commit 98f0071

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
ruby: [ '2.4', '2.5', '2.6', '2.7', '3.0', jruby-9.2 ]
2121
env:
2222
version: ${{ format('ruby:{0}', matrix.ruby) }}
23+
DOCKER_LOGIN: ${{ secrets.DOCKER_USERNAME && secrets.DOCKER_AUTH_TOKEN }}
2324
steps:
2425
- name: Revise env version if necessary
2526
run: echo "version=jruby:9.2" >> $GITHUB_ENV
@@ -30,18 +31,19 @@ jobs:
3031
with:
3132
fetch-depth: 0
3233

33-
- name: Set up Ruby
34-
uses: ruby/setup-ruby@v1
35-
with:
36-
ruby-version: ${{ matrix.ruby }}
37-
bundler-cache: true
38-
3934
- name: Login to Docker Hub
35+
if: env.DOCKER_LOGIN
4036
uses: docker/login-action@v1
4137
with:
4238
username: ${{ secrets.DOCKER_USERNAME }}
4339
password: ${{ secrets.DOCKER_AUTH_TOKEN }}
4440

41+
- name: Set up Ruby
42+
uses: ruby/setup-ruby@v1
43+
with:
44+
ruby-version: ${{ matrix.ruby }}
45+
bundler-cache: true
46+
4547
- run: make install
4648

4749
- name: Set up linter

0 commit comments

Comments
 (0)