@@ -22,13 +22,17 @@ inputs:
22
22
runs :
23
23
using : composite
24
24
steps :
25
- - name : Setup Docker Buildx
26
- uses : docker/setup-buildx-action@v2
27
-
28
- - name : Install jq
25
+ - name : Install jq and vcstool
29
26
run : |
30
27
sudo apt-get -y update
31
- sudo apt-get -y install jq
28
+ sudo apt-get -y install jq python3-pip
29
+ pip install --no-cache-dir vcstool
30
+ shell : bash
31
+
32
+ - name : Run vcs import
33
+ run : |
34
+ mkdir src
35
+ vcs import src < autoware.repos
32
36
shell : bash
33
37
34
38
- name : Set Docker tags
50
54
echo "$EOF" >> $GITHUB_OUTPUT
51
55
shell : bash
52
56
57
+ - name : Docker meta for base
58
+ id : meta-base
59
+ uses : docker/metadata-action@v5
60
+ with :
61
+ images : ghcr.io/${{ github.repository_owner }}/${{ inputs.bake-target }}
62
+ tags : ${{ steps.set-docker-tags.outputs.tags }}
63
+ bake-target : docker-metadata-action-base
64
+ flavor : |
65
+ latest=false
66
+ suffix=-base
67
+
53
68
- name : Docker meta for prebuilt
54
69
id : meta-prebuilt
55
- uses : docker/metadata-action@v4
70
+ uses : docker/metadata-action@v5
56
71
with :
57
72
images : ghcr.io/${{ github.repository_owner }}/${{ inputs.bake-target }}
58
73
tags : ${{ steps.set-docker-tags.outputs.tags }}
63
78
64
79
- name : Docker meta for devel
65
80
id : meta-devel
66
- uses : docker/metadata-action@v4
81
+ uses : docker/metadata-action@v5
67
82
with :
68
83
images : ghcr.io/${{ github.repository_owner }}/${{ inputs.bake-target }}
69
84
tags : ${{ steps.set-docker-tags.outputs.tags }}
73
88
suffix=-devel${{ inputs.tag-suffix }}
74
89
75
90
- name : Docker meta for runtime
76
- if : ${{ github.event_name == 'workflow_dispatch' }} || ${{ (github.event_name == 'push' && github.ref_type == 'tag') }}
91
+ if : ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref_type == 'tag') }}
77
92
id : meta-runtime
78
- uses : docker/metadata-action@v4
93
+ uses : docker/metadata-action@v5
79
94
with :
80
95
images : ghcr.io/${{ github.repository_owner }}/${{ inputs.bake-target }}
81
96
tags : ${{ steps.set-docker-tags.outputs.tags }}
@@ -86,99 +101,40 @@ runs:
86
101
87
102
- name : Login to GitHub Container Registry
88
103
if : ${{ github.event_name != 'pull_request' }}
89
- uses : docker/login-action@v2
104
+ uses : docker/login-action@v3
90
105
with :
91
106
registry : ghcr.io
92
107
username : ${{ github.repository_owner }}
93
108
password : ${{ github.token }}
94
109
95
- - name : Build and Push - prebuilt and devel
96
- if : ${{ (github.event_name == 'push' && github.ref_type == 'branch') || github.event_name == 'schedule' }}
97
- uses : docker/bake-action@v3
110
+ - name : Build and Push to GitHub Container Registry
111
+ if : ${{ github.event_name == 'push' ||
112
+ github.event_name == 'schedule' ||
113
+ (github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'registry') }}
114
+ uses : docker/bake-action@v5
98
115
with :
99
116
push : ${{ inputs.allow-push == 'true' }}
100
117
files : |
101
- docker/${{ inputs.bake-target }}/docker-bake.hcl
118
+ docker/docker-bake.hcl
119
+ ${{ steps.meta-base.outputs.bake-file }}
102
120
${{ steps.meta-prebuilt.outputs.bake-file }}
103
121
${{ steps.meta-devel.outputs.bake-file }}
104
- targets : |
105
- prebuilt
106
- devel
107
- provenance : false
108
- set : |
109
- ${{ inputs.build-args }}
110
-
111
- - name : Build and Publish to GitHub Container Registry
112
- if : ${{ ( github.event_name == 'push' && github.ref_type == 'tag' ) || ( github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'registry') }}
113
- uses : docker/bake-action@v3
114
- with :
115
- push : true
116
- files : |
117
- docker/${{ inputs.bake-target }}/docker-bake.hcl
118
- ${{ steps.meta-devel.outputs.bake-file }}
119
- ${{ steps.meta-prebuilt.outputs.bake-file }}
120
122
${{ steps.meta-runtime.outputs.bake-file }}
121
123
provenance : false
122
124
set : |
123
125
${{ inputs.build-args }}
124
126
125
- - name : Build and Save Artifacts
127
+ - name : Build only
126
128
if : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }}
127
- uses : docker/bake-action@v3
129
+ uses : docker/bake-action@v5
128
130
with :
129
131
push : false
130
132
files : |
131
- docker/${{ inputs.bake-target }}/ docker-bake.hcl
132
- ${{ steps.meta-devel .outputs.bake-file }}
133
+ docker/docker-bake.hcl
134
+ ${{ steps.meta-base .outputs.bake-file }}
133
135
${{ steps.meta-prebuilt.outputs.bake-file }}
136
+ ${{ steps.meta-devel.outputs.bake-file }}
134
137
${{ steps.meta-runtime.outputs.bake-file }}
135
138
provenance : false
136
139
set : |
137
140
${{ inputs.build-args }}
138
- prebuilt.output=type=docker,dest=/tmp/prebuilt.tar
139
- devel.output=type=docker,dest=/tmp/devel.tar
140
- runtime.output=type=docker,dest=/tmp/runtime.tar
141
-
142
- - name : Upload Artifact - prebuilt
143
- if : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }}
144
- id : artifact-upload-step-prebuilt
145
- uses : actions/upload-artifact@v4
146
- with :
147
- name : prebuilt-image${{ inputs.tag-suffix }}
148
- path : /tmp/prebuilt.tar
149
- retention-days : 7
150
- compression-level : 6
151
- overwrite : true
152
- if-no-files-found : error
153
-
154
- - name : Upload Artifact - devel
155
- if : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }}
156
- id : artifact-upload-step-devel
157
- uses : actions/upload-artifact@v4
158
- with :
159
- name : devel-image${{ inputs.tag-suffix }}
160
- path : /tmp/devel.tar
161
- retention-days : 7
162
- compression-level : 6
163
- overwrite : true
164
- if-no-files-found : error
165
-
166
- - name : Upload Artifact - runtime
167
- if : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }}
168
- id : artifact-upload-step-runtime
169
- uses : actions/upload-artifact@v4
170
- with :
171
- name : runtime-image${{ inputs.tag-suffix }}
172
- path : /tmp/runtime.tar
173
- retention-days : 7
174
- compression-level : 6
175
- overwrite : true
176
- if-no-files-found : error
177
-
178
- - name : Output artifact URLs
179
- id : output-artifact-urls
180
- run : |
181
- echo 'prebuilt URL ${{ steps.artifact-upload-step-prebuilt.outputs.artifact-url }}'
182
- echo 'devel URL ${{ steps.artifact-upload-step-devel.outputs.artifact-url }}'
183
- echo 'runtime URL ${{ steps.artifact-upload-step-runtime.outputs.artifact-url }}'
184
- shell : bash
0 commit comments