Skip to content

Commit

Permalink
chore: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp committed Apr 2, 2024
1 parent e8fea4e commit 3abc3a3
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/build-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on: # yamllint disable-line rule:truthy

env:
DOCKER_NAMESPACE: wayofdev/php-base
GHCR_NAMESPACE: ghcr.io/wayofdev/php-base
GHCR_NAMESPACE: ghcr.io/wayofdev/docker-php-base

name: 🚀 Build docker images with latest tag

Expand Down Expand Up @@ -152,12 +152,6 @@ jobs:

merge:
needs: build
strategy:
fail-fast: false
matrix:
images:
- 8.1-fpm-alpine
- 8.2-fpm-alpine
runs-on: ubuntu-latest
steps:

Expand Down Expand Up @@ -193,4 +187,25 @@ jobs:
with:
buildkitd-flags: "--debug"

- name: Create manifest list and push
run: |
# Aggregate all tags from the meta files
TAGS=$(jq -r '.target."docker-metadata-action".tags[]' /tmp/meta/bake-meta-*.json | sort -u)
# Loop through each tag and create a manifest list
for TAG in $TAGS; do
FULL_TAGS=()
for FILE in /tmp/meta/bake-meta-*.json; do
if jq -e --arg TAG "$TAG" '.target."docker-metadata-action".tags[] | select(. == $TAG)' $FILE > /dev/null; then
# Extract the repository and digest for the current platform
REPO=$(jq -r --arg TAG "$TAG" '.target."docker-metadata-action".tags[] | select(. == $TAG)' $FILE | cut -d':' -f1)
DIGEST=$(jq -r '.["'$REPO'"]["containerimage.digest"]' $FILE)
FULL_TAGS+=("$REPO@$DIGEST")
fi
done
# Create and push the manifest list for the current tag
docker buildx imagetools create "${FULL_TAGS[@]}" -t "$TAG"
done
...

0 comments on commit 3abc3a3

Please sign in to comment.