diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index a7fac5e..84ae5f8 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -7,10 +7,21 @@ jobs: name: Build Docker image runs-on: ubuntu-latest steps: + - name: Check token is set + id: vars + shell: bash + run: | + unset HAS_SECRET + if [-n $SECRET]; then HAS_SECRET='true' ; fi + echo ::set-output name=HAS_SECRET_TOKEN::${HAS_SECRET} + env: + SECRET: "${{ secrets.DOCKER_TOKEN }}" - name: Check out the repo uses: actions/checkout@v2 + if: ${{ steps.vars.outputs.HAS_SECRET }} - name: Push to Docker Hub uses: docker/build-push-action@v1 + if: ${{ steps.vars.outputs.HAS_SECRET }} with: username: thirtythreeforty password: ${{ secrets.DOCKER_TOKEN }}