Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,20 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Push to Docker Hub only when credentials are configured; forks and
# repos without DOCKERHUB_* secrets still get a build-only smoke test.
- name: Check Docker Hub credentials
id: creds
run: |
if [ -n "${{ secrets.DOCKERHUB_USERNAME }}" ] && [ -n "${{ secrets.DOCKERHUB_TOKEN }}" ]; then
echo "available=true" >> "$GITHUB_OUTPUT"
else
echo "available=false" >> "$GITHUB_OUTPUT"
echo "DOCKERHUB_USERNAME/DOCKERHUB_TOKEN not set; building without push" >> "$GITHUB_STEP_SUMMARY"
fi

- name: Login to Docker Hub
if: steps.creds.outputs.available == 'true'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand All @@ -105,8 +118,8 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
push: ${{ steps.creds.outputs.available == 'true' }}
platforms: ${{ steps.creds.outputs.available == 'true' && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
build-args: VERSION=${{ steps.version.outputs.sha_short }}
tags: |
impingo/liveforge:latest
Expand Down
Loading