Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tsoc
superbenchmark
Commits
b9864244
Unverified
Commit
b9864244
authored
Oct 07, 2025
by
Yifan Xiong
Committed by
GitHub
Oct 07, 2025
Browse files
CI/CD - Fix image merge in GitHub Action. (#749)
Fix image merge for release event in GitHub Action.
parent
60189dd6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
.github/workflows/build-image.yml
.github/workflows/build-image.yml
+15
-3
No files found.
.github/workflows/build-image.yml
View file @
b9864244
...
@@ -220,8 +220,9 @@ jobs:
...
@@ -220,8 +220,9 @@ jobs:
fi
fi
if [[ "${{ github.event_name }}" == "release" ]]; then
if [[ "${{ github.event_name }}" == "release" ]]; then
TAGS=$(sed "s/main:/superbench:${GITHUB_REF##*/}-/g" <<< ${TAGS})
TAGS=$(sed "s/main:/superbench:${GITHUB_REF##*/}-/g" <<< ${TAGS})
GHCR_TAG=$(cut -d, -f1 <<< ${TAGS} | sed "s#superbench/superbench#ghcr.io/${{ github.repository }}/superbench#g")
GHCR_TAGS=$(sed "s#superbench/superbench#ghcr.io/${{ github.repository }}/superbench#g" <<< ${TAGS})
TAGS="${TAGS},${GHCR_TAG}"
SOURCES=$(sed "s/main:/superbench:${GITHUB_REF##*/}-/g" <<< ${SOURCES})
GHCR_SOURCES=$(sed "s#superbench/superbench#ghcr.io/${{ github.repository }}/superbench#g" <<< ${SOURCES})
fi
fi
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
TAGS=$(sed "s/main:/dev:/g" <<< ${TAGS})
TAGS=$(sed "s/main:/dev:/g" <<< ${TAGS})
...
@@ -230,6 +231,8 @@ jobs:
...
@@ -230,6 +231,8 @@ jobs:
echo "tags=${TAGS}" >> "$GITHUB_OUTPUT"
echo "tags=${TAGS}" >> "$GITHUB_OUTPUT"
echo "sources=${SOURCES}" >> "$GITHUB_OUTPUT"
echo "sources=${SOURCES}" >> "$GITHUB_OUTPUT"
echo "ghcr_tags=${GHCR_TAGS}" >> "$GITHUB_OUTPUT"
echo "ghcr_sources=${GHCR_SOURCES}" >> "$GITHUB_OUTPUT"
-
name
:
Echo image tags
-
name
:
Echo image tags
run
:
echo ${{ steps.metadata.outputs.tags }}
run
:
echo ${{ steps.metadata.outputs.tags }}
-
name
:
Echo image sourcs
-
name
:
Echo image sourcs
...
@@ -251,7 +254,7 @@ jobs:
...
@@ -251,7 +254,7 @@ jobs:
registry
:
ghcr.io
registry
:
ghcr.io
username
:
${{ github.actor }}
username
:
${{ github.actor }}
password
:
${{ secrets.GITHUB_TOKEN }}
password
:
${{ secrets.GITHUB_TOKEN }}
-
name
:
Merge and push
-
name
:
Merge and push
to Docker Hub
if
:
${{ github.event_name != 'pull_request' }}
if
:
${{ github.event_name != 'pull_request' }}
run
:
|
run
:
|
docker buildx imagetools create \
docker buildx imagetools create \
...
@@ -260,6 +263,15 @@ jobs:
...
@@ -260,6 +263,15 @@ jobs:
--annotation "index:org.opencontainers.image.revision=${{ github.sha }}" \
--annotation "index:org.opencontainers.image.revision=${{ github.sha }}" \
--tag ${{ steps.metadata.outputs.tags }} \
--tag ${{ steps.metadata.outputs.tags }} \
${{ steps.metadata.outputs.sources }}
${{ steps.metadata.outputs.sources }}
-
name
:
Merge and push to GitHub Container Registry
if
:
${{ github.event_name == 'release' }}
run
:
|
docker buildx imagetools create \
--annotation "index:org.opencontainers.image.source=${{ github.event.repository.html_url }}" \
--annotation "index:org.opencontainers.image.created=${{ github.event.repository.pushed_at }}" \
--annotation "index:org.opencontainers.image.revision=${{ github.sha }}" \
--tag ${{ steps.metadata.outputs.ghcr_tags }} \
${{ steps.metadata.outputs.ghcr_sources }}
-
name
:
Inspect image
-
name
:
Inspect image
if
:
${{ github.event_name != 'pull_request' }}
if
:
${{ github.event_name != 'pull_request' }}
run
:
|
run
:
|
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment