Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
Signed-off-by: Oguz Ozturk <[email protected]>
  • Loading branch information
oguzkaganozt committed Sep 11, 2024
1 parent 872febe commit cf30ad4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ runs:
vcs import src < autoware.repos
shell: bash

- name: Setup QEMU for cross-compilation if required
if: ${{ inputs.platform == 'arm64' }}
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ inputs.platform }}

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
with:
Expand Down
40 changes: 4 additions & 36 deletions .github/workflows/docker-build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,45 +89,13 @@ jobs:
*.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }}
*.args.SETUP_ARGS=${{ matrix.setup-args }}
*.args.LIB_DIR=${{ matrix.lib_dir }}
*.cache-from=type=inline,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.cuda }}-${{ matrix.platform }}-${{ github.ref_name }}
*.cache-from=type=inline,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.cuda }}-${{ matrix.platform }}-main
*.cache-to=type=inline,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.cuda }}-${{ matrix.platform }}-${{ github.ref_name }},mode=max
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.cuda }}-${{ matrix.platform }}-${{ github.ref_name }}
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.cuda }}-${{ matrix.platform }}-main
*.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.cuda }}-${{ matrix.platform }}-${{ github.ref_name }},mode=max
*.output=type=image,push=false
tag-suffix: ${{ matrix.additional-tag-suffix }}-${{ matrix.platform }}
tag-prefix: ${{ needs.load-env.outputs.rosdistro }}

- name: Show disk space
run: |
df -h
combine-and-push-multi-arch:
needs: docker-build
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Combine and push multi-arch images
run: |
for variant in "no-cuda" "cuda"; do
docker buildx imagetools create -t ghcr.io/${{ github.repository }}:${{ needs.load-env.outputs.rosdistro }}-${variant} \
ghcr.io/${{ github.repository }}:${{ needs.load-env.outputs.rosdistro }}-${variant}-amd64 \
ghcr.io/${{ github.repository }}:${{ needs.load-env.outputs.rosdistro }}-${variant}-arm64
done
# Push the combined images to the repository
for variant in "no-cuda" "cuda"; do
docker push ghcr.io/${{ github.repository }}:${{ needs.load-env.outputs.rosdistro }}-${variant}
done
- name: Show pushed images
run: |
docker buildx imagetools inspect ghcr.io/${{ github.repository }}:${{ needs.load-env.outputs.rosdistro }}-no-cuda
docker buildx imagetools inspect ghcr.io/${{ github.repository }}:${{ needs.load-env.outputs.rosdistro }}-cuda
df -h

0 comments on commit cf30ad4

Please sign in to comment.