Skip to content

docker-build-and-push #78

docker-build-and-push

docker-build-and-push #78

name: docker-build-and-push
on:
push:
branches:
- main
tags:
workflow_dispatch:
jobs:
load-env:
uses: ./.github/workflows/load-env.yaml
docker-build-and-push:
needs: load-env
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
name:
- no-cuda
- cuda
include:
- name: no-cuda
base_image_env: base_image
setup-args: --no-nvidia
additional-tag-suffix: ""
- name: cuda
base_image_env: base_image
additional-tag-suffix: -cuda
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up remote runner SSH
uses: MrSquaare/[email protected]
with:
host: ${{ secrets.COMMON_RUNNER_ARM64_01_IP }}
private-key: ${{ secrets.COMMON_RUNNER_ARM64_01_PRIVATE_KEY }}
private-key-name: common-runner-ssh-key
- name: Set git config
uses: autowarefoundation/autoware-github-actions/set-git-config@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Free disk space
uses: ./.github/actions/free-disk-space
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: |
*.env
*.repos
.github/actions/docker-build-and-push/action.yaml
.github/workflows/docker-build-and-push*.yaml
ansible-galaxy-requirements.yaml
ansible/**
docker/**
- name: Build 'Autoware'
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.ref_type == 'tag') }}
uses: ./.github/actions/docker-build-multi-platform
with:
common-runner-arm64-01-ip: ${{ secrets.COMMON_RUNNER_ARM64_01_IP }}
name: ${{ matrix.name }}
bake-target: autoware
build-args: |
*.platform=linux/amd64,linux/arm64
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }}
*.args.SETUP_ARGS=${{ matrix.setup-args }}
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ github.ref_name }}
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-main
*.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ github.ref_name }},mode=max
tag-suffix: ${{ matrix.additional-tag-suffix }}
tag-prefix: ${{ needs.load-env.outputs.rosdistro }}
- name: Show disk space
run: |
df -h