Skip to content

Commit

Permalink
Update docker-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
EirikKolas authored Sep 24, 2023
1 parent 89cdb79 commit 1679f38
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,49 @@ env:
jobs:
build-and-push-image:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
architecture:
- amd64
- arm64

permissions:
contents: read
packages: write

steps:
- name: Checkout own repository
uses: actions/checkout@v4

- name: Set up QEMU
if: matrix.architecture != 'amd64'
uses: docker/setup-qemu-action@v3

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

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

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.arm64-ros2
push: ${{ github.event_name != 'pull_request' }}
tags: user/app:latest
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.architecture }}-latest
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64
output: type=image,name=target,annotation-index.org.opencontainers.image.description=My multi-arch image

0 comments on commit 1679f38

Please sign in to comment.