diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index df1cc16..bfff704 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -24,6 +24,17 @@ jobs: - dev - build steps: + - name: Check for Docker Hub credentials (secrets) + id: docker-hub-credentials + run: if [ ${{ secrets.DOCKER_HUB_USERNAME == null || secrets.DOCKER_HUB_TOKEN == null }} = true ]; then exit 1; fi + continue-on-error: true + - name: Login to Docker Hub + id: docker-hub-login + if: ${{ steps.docker-hub-credentials.outcome == 'success' }} + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} - name: Check for GitHub Container Registry credentials (secrets) id: ghcr-credentials run: if [ ${{ secrets.GHCR_USERNAME == null || secrets.GHCR_TOKEN == null }} = true ]; then exit 1; fi @@ -36,17 +47,6 @@ jobs: registry: ghcr.io username: ${{ secrets.GHCR_USERNAME }} password: ${{ secrets.GHCR_TOKEN }} - - name: Check for Docker Hub credentials (secrets) - id: docker-hub-credentials - run: if [ ${{ secrets.DOCKER_HUB_USERNAME == null || secrets.DOCKER_HUB_TOKEN == null }} = true ]; then exit 1; fi - continue-on-error: true - - name: Login to Docker Hub - id: docker-hub-login - if: ${{ steps.docker-hub-credentials.outcome == 'success' }} - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_TOKEN }} - name: Prepare variables id: vars env: