Skip to content

feat: upstream to origin (#124) #24

feat: upstream to origin (#124)

feat: upstream to origin (#124) #24

name: docker-build-and-push-arm64
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: buildjet-16vcpu-ubuntu-2204-arm
steps:
- name: Check if PR author is the specific user
id: author-check
run: |
PR_AUTHOR=$(jq -r '.pull_request.user.login' "$GITHUB_EVENT_PATH")
if [[ "$PR_AUTHOR" == "youtalk" ]]; then
echo "$PR_AUTHOR is a target user"
echo "author-found=true" >> $GITHUB_OUTPUT
else
echo "$PR_AUTHOR is not a target user"
echo "author-found=false" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Check out repository
uses: actions/checkout@v4
- name: Set git config
uses: autowarefoundation/autoware-github-actions/set-git-config@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- 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' without CUDA
if: ${{ steps.author-check.outputs.author-found == 'true' ||
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-and-push
with:
platform: arm64
bake-target: autoware
build-args: |
*.platform=linux/arm64
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }}
*.args.LIB_DIR=aarch64
*.cache-from=type=registry,ref=${{ github.repository }}-buildcache:arm64-${{ github.head_ref }}
*.cache-from=type=registry,ref=${{ github.repository }}-buildcache:arm64-main
*.cache-to=type=registry,ref=${{ github.repository }}-buildcache:arm64-${{ github.head_ref }},mode=max
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build 'Autoware' with CUDA
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-and-push-cuda
with:
platform: arm64
bake-target: autoware
build-args: |
*.platform=linux/arm64
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }}
*.args.LIB_DIR=aarch64
*.cache-from=type=registry,ref=${{ github.repository }}-buildcache:arm64-${{ github.head_ref }}
*.cache-from=type=registry,ref=${{ github.repository }}-buildcache:arm64-main
*.cache-to=type=registry,ref=${{ github.repository }}-buildcache:arm64-${{ github.head_ref }},mode=max
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Show disk space
if: always()
run: |
df -h