Skip to content

Commit

Permalink
chore: update build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rayanebel committed Jan 9, 2025
1 parent 198f815 commit 41f095d
Showing 1 changed file with 54 additions and 2 deletions.
56 changes: 54 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ jobs:

- uses: docker/build-push-action@v6
name: Build & Push Container Images
id: build
with:
context: .
file: Dockerfile
Expand All @@ -140,14 +141,65 @@ jobs:
[email protected]
platforms: linux/${{matrix.arch}}
push: true
provenance: false
sbom: false
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |-
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-linux-${{matrix.arch}}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1

merge:
runs-on: ubuntu-latest
needs:
- images
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: /tmp/digests
pattern: digests-*
merge-multiple: true

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create \
-t "${{ env.REGISTRY_IMAGE }}:latest" \
-t "${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }}" \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
env:
REGISTRY_IMAGE: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}

- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:latest
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }}"
env:
REGISTRY_IMAGE: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}

helm-chart:
if: false
runs-on: ubuntu-latest
Expand Down

0 comments on commit 41f095d

Please sign in to comment.