Skip to content

Commit

Permalink
chore: fixes in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp committed Apr 2, 2024
1 parent c38f57b commit c7169fa
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/build-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ jobs:
- name: 🌎 Set environment variables
run: |
tag=${{ matrix.php_version }}-${{ matrix.php_type }}-${{ matrix.os_name }}-${{ matrix.builder.arch }}
echo "PLATFORM_TAG=${tag}" >> $GITHUB_ENV
php_version_slug="${{ matrix.php_version //./ }}"
target="php-${php_version_slug}-${{ matrix.php_type }}-${{ matrix.os_name }}"
echo "TARGET=${target}" >> $GITHUB_ENV
echo "PLATFORM_CACHE_TAG=${tag}" >> $GITHUB_ENV
- name: 📦 Check out the codebase
uses: actions/checkout@v4
Expand All @@ -48,7 +51,7 @@ jobs:
- name: 🛠️ Setup docker QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
- name: 🛠️ Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: "--debug"
Expand All @@ -71,33 +74,33 @@ jobs:
id: bake
uses: docker/bake-action@v3
with:
targets: php-81-${{ matrix.php_type }}-${{ matrix.os_name }}
targets: ${{ env.TARGET }}
files: |
./docker-bake.hcl
set: |
*.tags=
*.platform=linux/${{ matrix.builder.arch }}
*.cache-from=type=gha,scope=build-${{ env.PLATFORM_TAG }}
*.cache-to=type=gha,scope=build-${{ env.PLATFORM_TAG }}
*.cache-from=type=gha,scope=build-${{ env.PLATFORM_CACHE_TAG }}
*.cache-to=type=gha,scope=build-${{ env.PLATFORM_CACHE_TAG }}
*.output=type=image,"name=${{ env.DOCKER_NAMESPACE }},${{ env.GHCR_NAMESPACE }}",push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }}
- name: Debug Bake Metadata Output
- name: 🔍 Debug Bake Metadata Output
run: |
echo "${{ steps.bake.outputs.metadata }}"
- name: Export digest
- name: 📥 Export digest
run: |
mkdir -p /tmp/digests
echo "Bake Metadata: ${{ steps.bake.outputs.metadata }}"
digest=$(echo '${{ steps.bake.outputs.metadata }}' | jq -r '.["php-81-fpm-alpine"]["containerimage.digest"]')
digest=$(echo '${{ steps.bake.outputs.metadata }}' | jq -r '.["${{ env.TARGET }}"]["containerimage.digest"]')
if [[ -z "$digest" || "$digest" == "null" ]]; then
echo "Digest not found."
exit 1
fi
echo "Digest: $digest"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
- name: 📤 Upload digest
uses: actions/upload-artifact@v4
with:
name: digests
Expand Down

0 comments on commit c7169fa

Please sign in to comment.