-
Notifications
You must be signed in to change notification settings - Fork 61
140 lines (124 loc) · 3.77 KB
/
Docker.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Docker
on:
pull_request:
paths:
- "**"
- "!docs/**"
- "!README.md"
- "!CONTRIBUTING.md"
- "!.github/**"
- ".github/workflows/Docker.yaml"
- "!mkdocs.yml"
- "!pyproject.toml"
- "!poetry.lock"
workflow_dispatch:
inputs:
version:
description: version of the scenario_simulator_v2
required: true
jobs:
push_traffic_sim_docker:
name: Push Docker Image for traffic_simulator
runs-on: ubuntu-22.04
timeout-minutes: 720
strategy:
matrix:
rosdistro: [humble]
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
- name: Install docker for ubuntu runner
uses: docker/setup-buildx-action@v3
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
if: github.event_name == 'pull_request'
uses: docker/[email protected]
with:
files: |
./docker-bake.hcl
workdir: .
set: |
*.cache-to=type=gha,mode=max
*.cache-from=type=gha
push: false
targets: |
traffic_simulator_${{ matrix.rosdistro }}
- name: Build and push
if: github.event_name == 'workflow_dispatch'
uses: docker/[email protected]
with:
files: |
./docker-bake.hcl
workdir: .
set: |
*.cache-to=type=gha,mode=max
*.cache-from=type=gha
*.tags=ghcr.io/tier4/scenario_simulator_v2:traffic_simulator_${{ matrix.rosdistro }}-${{ github.event.inputs.version }}
push: true
targets: |
traffic_simulator_${{ matrix.rosdistro }}
push_docker:
name: Push Docker Image
runs-on: ubuntu-22.04
timeout-minutes: 720
strategy:
matrix:
rosdistro: [humble]
# arch: [amd64, arm64]
arch: [amd64]
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
- name: Install docker for ubuntu runner
uses: docker/setup-buildx-action@v3
- name: Install QEMU
uses: docker/setup-qemu-action@v3
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Qemu Setup
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --use
docker buildx inspect --bootstrap
- name: Build (${{ matrix.arch }})
if: github.event_name == 'pull_request'
uses: docker/[email protected]
with:
files: |
./docker-bake.hcl
workdir: .
set: |
*.cache-to=type=gha,mode=max
*.cache-from=type=gha
push: false
targets: |
${{ matrix.rosdistro }}_base_${{ matrix.arch }}
- name: Build and push (${{ matrix.arch }})
if: github.event_name == 'workflow_dispatch'
uses: docker/[email protected]
with:
files: |
./docker-bake.hcl
workdir: .
set: |
*.cache-to=type=gha,mode=max
*.cache-from=type=gha
*.tags=ghcr.io/tier4/scenario_simulator_v2:humble-${{ github.event.inputs.version }}
push: true
targets: |
${{ matrix.rosdistro }}_base_${{ matrix.arch }}