Skip to content

Commit

Permalink
fix: run docker publish if it available
Browse files Browse the repository at this point in the history
  • Loading branch information
IKatsuba committed Jan 11, 2024
1 parent d81fc61 commit e4201e7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/publish-to-docker-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,22 @@ on:
- 'main'

jobs:
check_secrets:
runs-on: ubuntu-latest
outputs:
secrets_available: ${{ steps.check.outputs.secrets_available }}
steps:
- id: check
run: |
if [[ -n "${{ secrets.DOCKERHUB_USERNAME }}" && -n "${{ secrets.DOCKERHUB_TOKEN }}" ]]; then
echo "::set-output name=secrets_available::true"
else
echo "::set-output name=secrets_available::false"
fi
shell: bash
build:
needs: check_secrets
if: ${{ needs.check_secrets.outputs.secrets_available == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down

0 comments on commit e4201e7

Please # to comment.