From bb5f036706b4b592f7e181cca594e497fee5b7d3 Mon Sep 17 00:00:00 2001 From: innovaker <66737976+innovaker@users.noreply.github.com> Date: Fri, 14 May 2021 19:12:34 +0100 Subject: [PATCH] refactor: swap Docker Hub steps with GHCR steps Aligns with the ordering elsewhere. PR: #32 --- .github/workflows/containers.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) 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: