Skip to content

Commit

Permalink
ci: fix expression in build workflow (#42)
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Beaumont <[email protected]>
  • Loading branch information
michaelbeaumont authored Mar 28, 2024
1 parent e0d8ac8 commit c004b19
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ permissions:

env:
DOCKER_REPO: kumahq/kuma-demo
PUSH_IMAGE: ${{ toJSON(github.event_name == 'push' || fromJSON(inputs.push)) }}

jobs:
build-and-push:
Expand All @@ -30,14 +31,14 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
if: ${{ fromJSON(inputs.push) }}
if: fromJSON(env.PUSH_IMAGE)
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_API_KEY }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: ${{ github.event_name == 'push' || fromJSON(inputs.push) }}
push: ${{ fromJSON(env.PUSH_IMAGE) }}
platforms: linux/amd64, linux/arm64
tags: ${{ env.DOCKER_REPO }}:${{ github.event_name == 'push' && 'dev' || inputs.tag }}

0 comments on commit c004b19

Please sign in to comment.