Skip to content

Commit

Permalink
fix: build docker when workflow explicitly includes component (#1498)
Browse files Browse the repository at this point in the history
## Summary
We have a workflow docker build which specifies a component but that was
only building that component if the tag passed in was also a target tag.
  • Loading branch information
joroshiba committed Sep 13, 2024
1 parent ac7222e commit 8bc06f1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
package-name: composer
binary-name: composer
tag: ${{ inputs.tag }}
force: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'composer' }}
secrets: inherit

conductor:
Expand All @@ -66,6 +67,7 @@ jobs:
package-name: conductor
binary-name: conductor
tag: ${{ inputs.tag }}
force: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'conductor' }}
secrets: inherit

sequencer:
Expand All @@ -81,6 +83,7 @@ jobs:
package-name: sequencer
binary-name: sequencer
tag: ${{ inputs.tag }}
force: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'sequencer' }}
secrets: inherit

sequencer-relayer:
Expand All @@ -96,6 +99,7 @@ jobs:
package-name: sequencer-relayer
binary-name: sequencer-relayer
tag: ${{ inputs.tag }}
force: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'sequencer-relayer' }}
secrets: inherit

evm-bridge-withdrawer:
Expand All @@ -111,6 +115,7 @@ jobs:
package-name: evm-bridge-withdrawer
binary-name: bridge-withdrawer
tag: ${{ inputs.tag }}
force: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'evm-bridge-withdrawer' }}
secrets: inherit

smoke-test:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/reusable-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ on:
tag:
required: false
type: string
force:
required: false
type: boolean
default: false
secrets:
DOCKER_TOKEN:
required: false
Expand All @@ -34,7 +38,7 @@ jobs:
contents: read
id-token: write
packages: write
if: startsWith(inputs.tag, inputs.binary-name) || !inputs.tag && (startsWith(github.ref, format('refs/tags/{0}-v', inputs.binary-name)) || github.ref == 'refs/heads/main' || github.event_name == 'pull_request' || github.event_name == 'merge_group')
if: inputs.force || startsWith(inputs.tag, inputs.binary-name) || !inputs.tag && (startsWith(github.ref, format('refs/tags/{0}-v', inputs.binary-name)) || github.ref == 'refs/heads/main' || github.event_name == 'pull_request' || github.event_name == 'merge_group')
steps:
# Checking out the repo
- uses: actions/checkout@v4
Expand Down

0 comments on commit 8bc06f1

Please sign in to comment.