Skip to content

Commit 86d1bb4

Browse files
committed
Update Docker workflow to handle manual dispatch and improve caching strategy
1 parent 4a643a4 commit 86d1bb4

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/docker.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,25 @@ jobs:
1717
check_release:
1818
runs-on: ubuntu-latest
1919
if: |
20+
github.event_name == 'workflow_dispatch' ||
2021
github.event.workflow_run.conclusion == 'success'
2122
outputs:
2223
should_run: ${{ steps.commit.outputs.should_run }}
2324
steps:
2425
- uses: actions/checkout@v4
2526
with:
26-
ref: ${{ github.event.workflow_run.head_branch }}
27+
ref: ${{ github.event.workflow_run.head_branch || github.ref }}
2728
- name: Check for release
2829
id: commit
2930
run: |
3031
COMMIT_MSG=$(git log -1 --pretty=format:%s)
3132
echo "message=$COMMIT_MSG" >> $GITHUB_OUTPUT
3233
echo "Commit message: $COMMIT_MSG"
3334
34-
# Check if this is a merge from changeset-release branch
35-
if [[ "$COMMIT_MSG" == *"changeset-release"* ]]; then
35+
# For manual dispatch, always run. For workflow_run, check for changeset-release
36+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
37+
echo "should_run=true" >> $GITHUB_OUTPUT
38+
elif [[ "$COMMIT_MSG" == *"changeset-release"* ]]; then
3639
echo "should_run=true" >> $GITHUB_OUTPUT
3740
else
3841
echo "should_run=false" >> $GITHUB_OUTPUT
@@ -93,10 +96,13 @@ jobs:
9396
push: true
9497
tags: ${{ steps.meta.outputs.tags }}
9598
labels: ${{ steps.meta.outputs.labels }}
99+
build-args: |
100+
RELAY_VERSION=${{ steps.package_version.outputs.version }}
96101
cache-from: |
102+
type=gha,scope=relay/${{ github.ref_name }}-${{ steps.package_version.outputs.version }}
97103
type=gha,scope=relay/${{ github.ref_name }}
98104
cache-to: |
99-
type=gha,scope=relay/${{ github.ref_name }},mode=min
105+
type=gha,scope=relay/${{ github.ref_name }}-${{ steps.package_version.outputs.version }},mode=max
100106
provenance: true
101107
sbom: true
102108

0 commit comments

Comments
 (0)