Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,9 @@ jobs:
fi
if [[ "${{ github.event_name }}" == "release" ]]; then
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")
TAGS="${TAGS},${GHCR_TAG}"
GHCR_TAGS=$(sed "s#superbench/superbench#ghcr.io/${{ github.repository }}/superbench#g" <<< ${TAGS})
SOURCES=$(sed "s/main:/superbench:${GITHUB_REF##*/}-/g" <<< ${SOURCES})
GHCR_SOURCES=$(sed "s#superbench/superbench#ghcr.io/${{ github.repository }}/superbench#g" <<< ${SOURCES})
fi
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
TAGS=$(sed "s/main:/dev:/g" <<< ${TAGS})
Expand All @@ -230,6 +231,8 @@ jobs:

echo "tags=${TAGS}" >> "$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
run: echo ${{ steps.metadata.outputs.tags }}
- name: Echo image sourcs
Expand All @@ -251,7 +254,7 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Merge and push
- name: Merge and push to Docker Hub
if: ${{ github.event_name != 'pull_request' }}
run: |
docker buildx imagetools create \
Expand All @@ -260,6 +263,15 @@ jobs:
--annotation "index:org.opencontainers.image.revision=${{ github.sha }}" \
--tag ${{ steps.metadata.outputs.tags }} \
${{ 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
if: ${{ github.event_name != 'pull_request' }}
run: |
Expand Down
Loading