-
Notifications
You must be signed in to change notification settings - Fork 8
ci: use multiarch runners for docker builds #379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
| 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: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is |
||
| tags: ${{ needs.build-and-export-digest.outputs.tags }} | ||
There was a problem hiding this comment.
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