diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 34834fe..0612c79 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -10,6 +10,14 @@ on: jobs: build-and-push: runs-on: ubuntu-latest + + # we need to copy the value to env, + # because the "if" at job level cannot access secrets directly + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + # run the rest only if the env var is set and not empty + if: ${{ env.DOCKER_USERNAME != '' }} + steps: - name: Checkout uses: actions/checkout@v4