mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-07 08:06:37 +08:00
feat: enhance Docker image workflow with improved digest handling
This commit is contained in:
@@ -43,12 +43,12 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Log into registry
|
- name: Log into registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
id: build
|
id: build
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
@@ -124,10 +124,21 @@ jobs:
|
|||||||
working-directory: /tmp/digests
|
working-directory: /tmp/digests
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
shopt -s nullglob
|
||||||
|
references=()
|
||||||
|
for digest in *; do
|
||||||
|
references+=("${IMAGE}@sha256:${digest}")
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ${#references[@]} -eq 0 ]; then
|
||||||
|
echo "No digests found in /tmp/digests" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
docker buildx imagetools create \
|
docker buildx imagetools create \
|
||||||
-t "${IMAGE}:${VERSION}" \
|
-t "${IMAGE}:${VERSION}" \
|
||||||
-t "${IMAGE}:latest" \
|
-t "${IMAGE}:latest" \
|
||||||
$(printf '%s@sha256:%s ' "${IMAGE}" *)
|
"${references[@]}"
|
||||||
|
|
||||||
- name: Inspect image
|
- name: Inspect image
|
||||||
run: docker buildx imagetools inspect "${IMAGE}:${VERSION}"
|
run: docker buildx imagetools inspect "${IMAGE}:${VERSION}"
|
||||||
|
|||||||
Reference in New Issue
Block a user