Skip to content
Closed
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
52 changes: 44 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,60 @@ env:
type=ref,event=branch,enable={{is_default_branch}}
type=semver,pattern={{version}},value=${{ inputs.tag }},enable=${{ inputs.tag != '' }}


jobs:
main:
build-and-export-digest:
permissions:
contents: read
id-token: write

runs-on: ubuntu-latest
outputs:
images: ${{ steps.build.outputs.images }}
tags: ${{ steps.build.outputs.tags }}

strategy:
fail-fast: false
matrix:
include:
- runnerType: ubuntu-24.04-arm
platform: linux/arm64
- runnerType: ubuntu-24.04
platform: linux/amd64

runs-on: ${{ matrix.runnerType }}
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

- name: Build Docker image
uses: grafana/shared-workflows/actions/build-push-to-dockerhub@06f8765f6a5043b01e5a3dddd78a71741552add7 # build-push-to-dockerhub/v0.3.0
- name: Build Docker Image
id: build
uses: grafana/shared-workflows/actions/docker-build-push-image@c658f0fe8393e31c39d266684ef273c6538ed0e1 # docker-build-push-image/v0.1.0
with:
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name == 'push' || github.event_name == 'workflow_call' }}
registries: "dockerhub"
platforms: ${{ matrix.platform }}
outputs: "type=image,push-by-digest=true,name-canonical=true,push=false"
push: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it right that we're never pushing? Perhaps I'm understanding the flag incorrectly

tags: ${{ env.TAGS_CONFIG }}
repository: ${{ github.repository }}
include-tags-in-push: false

- name: Export Docker Digest
id: export
uses: grafana/shared-workflows/actions/docker-export-digest@9901fa1e9c9cd7e78bb556c0ff4339932837082e # docker-export-digest/v0.1.0
with:
digest: ${{ steps.build.outputs.digest }}
platform: ${{ matrix.platform }}

push-manifest:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be conditional on whether we're pushing or not? We could skip the job on PRs, AFAIK

runs-on: ubuntu-24.04
needs: build-and-export-digest
permissions:
contents: read
id-token: write
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed?

steps:
- name: Download Multi-Arch Digests, Construct and Upload Manifest
uses: grafana/shared-workflows/actions/docker-import-digests-push-manifest@cd422befbbda65e0612a63627e8c8820d86bc2a6 # docker-import-digests-push-manifest/v0.1.0
with:
images: ${{ needs.build-and-export-digest.outputs.images }}
push: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is push: false right?

tags: ${{ needs.build-and-export-digest.outputs.tags }}
Loading