-
Notifications
You must be signed in to change notification settings - Fork 3.1k
83 lines (75 loc) · 2.75 KB
/
docker-build-and-push.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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
platform: amd64
base_image_env: base_image
lib_dir: x86_64
setup-args: --no-nvidia
additional-tag-suffix: ""
- name: cuda
platform: amd64
base_image_env: base_image
lib_dir: x86_64
additional-tag-suffix: -cuda
steps:
- 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: 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-and-push
with:
name: ${{ matrix.name }}
platform: ${{ matrix.platform }}
bake-target: autoware
build-args: |
*.platform=linux/${{ matrix.platform }}
*.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 }}
*.args.LIB_DIR=${{ matrix.lib_dir }}
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-${{ github.ref_name }}
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-main
*.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-${{ github.ref_name }},mode=max
tag-suffix: ${{ matrix.additional-tag-suffix }}-${{ matrix.platform }}
tag-prefix: ${{ needs.load-env.outputs.rosdistro }}
- name: Show disk space
run: |
df -h