Skip to content

Commit

Permalink
push image to multiple platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
dB2510 committed Apr 4, 2022
1 parent d7330a3 commit 52ddd0c
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
on:
pull_request:
push:
branches:
- main
Expand All @@ -10,24 +11,37 @@ jobs:
name: Build Docker Image
steps:

- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

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

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

- id: get-version
run: |
version=$(echo "${{ github.sha }}" | cut -c1-8)
echo "::set-output name=version::$version"
- name: Publish to registry
uses: elgohr/Publish-Docker-Github-Action@3.04
uses: docker/build-push-action@v2
env:
NODE_ENV: production
DOCKER_BUILDKIT: 1
with:
name: ${{ github.repository }}/charon
username: ${{ github.actor }}
password: ${{ secrets.CONTAINER_REGISTRY_SECRET }}
buildargs: GITHUB_SHA=${{ github.sha }}
registry: ghcr.io
context: .
platforms: linux/amd64,linux/arm64
push: true
build-args: GITHUB_SHA=${{ github.sha }}
tags: "latest,${{steps.get-version.outputs.version}}"

- name: Image digest
Expand Down

0 comments on commit 52ddd0c

Please sign in to comment.