Skip to content

Commit

Permalink
ci: run docker action only if docker username is set
Browse files Browse the repository at this point in the history
  • Loading branch information
prusnak committed Dec 23, 2024
1 parent 1472016 commit 375d3a3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 375d3a3

Please sign in to comment.