aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/images.yml6
1 files changed, 4 insertions, 2 deletions
diff --git a/.github/workflows/images.yml b/.github/workflows/images.yml
index 87fae3b..1a1a2d9 100644
--- a/.github/workflows/images.yml
+++ b/.github/workflows/images.yml
@@ -21,6 +21,8 @@ on:
jobs:
build:
+ env:
+ HAS_DOCKER_CREDENTIALS: ${{ secrets.DOCKER_PASSWORD != '' }}
name: ${{ matrix.cfg.name }}
runs-on: ubuntu-latest
strategy:
@@ -38,7 +40,7 @@ jobs:
# Login to dockerhub
- name: Docker login
- if: github.event_name == 'push' || github.event_name == 'schedule'
+ if: (github.event_name == 'push' || github.event_name == 'schedule') && env.HAS_DOCKER_CREDENTIALS == 'true'
uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
@@ -52,5 +54,5 @@ jobs:
# Publish
- name: Push the ${{ matrix.cfg.id }} image
- if: github.event_name == 'push' || github.event_name == 'schedule'
run: docker push mesonbuild/${{ matrix.cfg.id }}
+ if: (github.event_name == 'push' || github.event_name == 'schedule') && env.HAS_DOCKER_CREDENTIALS == 'true'