Skip to content

Commit

Permalink
Publish multi-architecture images
Browse files Browse the repository at this point in the history
Signed-off-by: Jeev B <jeevb@users.noreply.github.com>
  • Loading branch information
jeevb committed Jan 7, 2023
1 parent 7c6453f commit 2f2b300
Showing 1 changed file with 30 additions and 9 deletions.
39 changes: 30 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ on:
description: "Push to registry"
required: false
type: boolean
before-build:
description: "Script to run before build"
required: false
type: string
secrets:
FLYTE_BOT_USERNAME:
required: true
Expand All @@ -32,15 +36,32 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Push Docker Image to Github Registry
uses: whoan/docker-build-with-cache-action@v5
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: "${{ secrets.FLYTE_BOT_USERNAME }}"
password: "${{ secrets.FLYTE_BOT_PAT }}"
image_name: ${{ inputs.repository }}
image_tag: latest,${{ github.sha }},${{ inputs.version }}
push_git_tag: ${{ inputs.push }}
push_image_and_stages: ${{ inputs.push }}
dockerfile: ${{ inputs.dockerfile }}
registry: ghcr.io
build_extra_args: "--compress=true"
- name: Prepare Image Tags
id: tags
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ inputs.repository }}
tags: |
type=raw,value=latest
type=raw,value=${{ inputs.version }}
type=sha,format=long,prefix=
- name: Before Build
run: ${{ inputs.before-build }}
- name: Build and Push Image
uses: docker/build-push-action@v3
with:
context: .
file: ${{ inputs.dockerfile }}
platforms: linux/arm64,linux/amd64
push: ${{ inputs.push }}
tags: ${{ steps.tags.outputs.tags }}

0 comments on commit 2f2b300

Please sign in to comment.