|
22 | 22 | * [outputs](#outputs)
|
23 | 23 | * [environment variables](#environment-variables)
|
24 | 24 | * [Subactions](#subactions)
|
25 |
| - * [`list-targets`](#list-targets) |
26 |
| - * [inputs](#inputs-1) |
27 |
| - * [outputs](#outputs-1) |
| 25 | + * [`list-targets`](subaction/list-targets) |
28 | 26 | * [Contributing](#contributing)
|
29 | 27 |
|
30 | 28 | ## Usage
|
@@ -216,76 +214,7 @@ The following outputs are available
|
216 | 214 |
|
217 | 215 | ## Subactions
|
218 | 216 |
|
219 |
| -### `list-targets` |
220 |
| - |
221 |
| -This subaction generates a list of Bake targets that can be used in a [GitHub matrix](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix), |
222 |
| -so you can distribute your builds across multiple runners. |
223 |
| - |
224 |
| -```hcl |
225 |
| -# docker-bake.hcl |
226 |
| -group "validate" { |
227 |
| - targets = ["lint", "doctoc"] |
228 |
| -} |
229 |
| -
|
230 |
| -target "lint" { |
231 |
| - target = "lint" |
232 |
| -} |
233 |
| -
|
234 |
| -target "doctoc" { |
235 |
| - target = "doctoc" |
236 |
| -} |
237 |
| -``` |
238 |
| - |
239 |
| -```yaml |
240 |
| -jobs: |
241 |
| - prepare: |
242 |
| - runs-on: ubuntu-latest |
243 |
| - outputs: |
244 |
| - targets: ${{ steps.generate.outputs.targets }} |
245 |
| - steps: |
246 |
| - - |
247 |
| - name: Checkout |
248 |
| - uses: actions/checkout@v4 |
249 |
| - - |
250 |
| - name: List targets |
251 |
| - id: generate |
252 |
| - uses: docker/bake-action/subaction/list-targets@v4 |
253 |
| - with: |
254 |
| - target: validate |
255 |
| -
|
256 |
| - validate: |
257 |
| - runs-on: ubuntu-latest |
258 |
| - needs: |
259 |
| - - prepare |
260 |
| - strategy: |
261 |
| - fail-fast: false |
262 |
| - matrix: |
263 |
| - target: ${{ fromJson(needs.prepare.outputs.targets) }} |
264 |
| - steps: |
265 |
| - - |
266 |
| - name: Checkout |
267 |
| - uses: actions/checkout@v4 |
268 |
| - - |
269 |
| - name: Validate |
270 |
| - uses: docker/bake-action@v5 |
271 |
| - with: |
272 |
| - targets: ${{ matrix.target }} |
273 |
| -``` |
274 |
| -#### inputs |
275 |
| - |
276 |
| -| Name | Type | Description | |
277 |
| -|--------------|-------------|---------------------------------------------------------------------------------------------------------------------------------------------| |
278 |
| -| `workdir` | String | Working directory to use (defaults to `.`) | |
279 |
| -| `files` | List/CSV | List of [bake definition files](https://docs.docker.com/build/customize/bake/file-definition/) | |
280 |
| -| `target` | String | The target to use within the bake file | |
281 |
| - |
282 |
| -#### outputs |
283 |
| - |
284 |
| -The following outputs are available |
285 |
| - |
286 |
| -| Name | Type | Description | |
287 |
| -|------------|----------|----------------------------| |
288 |
| -| `targets` | List/CSV | List of extracted targest | |
| 217 | +* [`list-targets`](subaction/list-targets) |
289 | 218 |
|
290 | 219 | ## Contributing
|
291 | 220 |
|
|
0 commit comments