Skip to content

Commit

Permalink
feat(TU-10158): build multi-arch images
Browse files Browse the repository at this point in the history
  • Loading branch information
aeryaguzov committed Mar 26, 2024
1 parent 9c0c4f4 commit 98cd947
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/image-multiarch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@ name: Build & push multi-arch image
on:
workflow_call:
secrets:
build-args:
description: "Build args"
required: false
repository:
GITHUB_TOKEN:
description: "GitHub token to download dependencies"
required: true
ECR_REGISTRY:
description: "Image repository"
required: true
inputs:
service:
description: "A name to tag the image"
type: string
required: true
build-args:
description: "Build args"
type: "string"
required: false
context:
description: "Build context"
type: string
Expand Down Expand Up @@ -46,19 +50,23 @@ jobs:
- name: Build and push images
uses: docker/build-push-action@v5
with:
build-args: ${{ secrets.build-args }}
build-args: ${{ inputs.build-args }}
context: ${{ inputs.context }}
labels: ${{ inputs.labels }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ secrets.repository }}/${{ inputs.service }}:${{ github.run_id }}
tags: ${{ secrets.ECR_REGISTRY }}/${{ inputs.service }}:${{ github.run_id }}
secrets: |
"github_token=${{ secrets.GITHUB_TOKEN }}"
- name: Push latest image
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: docker/build-push-action@v5
with:
build-args: ${{ secrets.build-args }}
build-args: ${{ inputs.build-args }}
context: ${{ inputs.context }}
labels: ${{ inputs.labels }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ secrets.repository }}/${{ inputs.service }}:latest
secrets: |
"github_token=${{ secrets.GITHUB_TOKEN }}"
tags: ${{ secrets.ECR_REGISTRY }}/${{ inputs.service }}:latest

0 comments on commit 98cd947

Please sign in to comment.