Skip to content

Commit cf8d187

Browse files
authored
fix: ci: publish correct docker tags on workflow dispatch (#12060)
1 parent a5ec2fb commit cf8d187

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/docker.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ jobs:
6868
with:
6969
submodules: 'recursive'
7070
ref: ${{ inputs.ref || github.ref }}
71+
- id: git
72+
env:
73+
REF: ${{ inputs.ref || github.ref }}
74+
run: |
75+
ref="${REF#refs/heads/}"
76+
ref="${ref#refs/tags/}"
77+
sha="$(git rev-parse --short HEAD)"
78+
echo "ref=$ref" | tee -a "$GITHUB_OUTPUT"
79+
echo "sha=$sha" | tee -a "$GITHUB_OUTPUT"
7180
- name: Set up Docker Buildx
7281
uses: docker/setup-buildx-action@v3
7382
- name: Docker meta
@@ -76,10 +85,9 @@ jobs:
7685
with:
7786
images: filecoin/${{ matrix.image }}
7887
tags: |
79-
type=schedule
80-
type=raw,enable=${{ github.event_name != 'schedule' && steps.channel.outputs.channel != '' }},value=${{ steps.channel.outputs.channel }}
81-
type=ref,event=tag
82-
type=sha,prefix=
88+
type=raw,enable=${{ steps.channel.outputs.channel != '' }},value=${{ steps.channel.outputs.channel }}
89+
type=raw,enable=${{ startsWith(inputs.ref || github.ref, 'refs/tags/') }},value=${{ steps.git.outputs.ref }}
90+
type=raw,value=${{ steps.git.outputs.sha }}
8391
flavor: |
8492
latest=false
8593
suffix=${{ matrix.network != 'mainnet' && format('-{0}', matrix.network) || '' }}

0 commit comments

Comments
 (0)