-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #231 from crazy-max/fix-readme
readme: fix environment variable block location
- Loading branch information
Showing
3 changed files
with
89 additions
and
74 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
## About | ||
|
||
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), | ||
so you can distribute your builds across multiple runners. | ||
|
||
![Screenshot](../../.github/bake-action.png) | ||
|
||
___ | ||
|
||
* [Usage](#usage) | ||
* [Customizing](#customizing) | ||
* [inputs](#inputs) | ||
* [outputs](#outputs) | ||
|
||
## Usage | ||
|
||
```hcl | ||
# docker-bake.hcl | ||
group "validate" { | ||
targets = ["lint", "doctoc"] | ||
} | ||
target "lint" { | ||
target = "lint" | ||
} | ||
target "doctoc" { | ||
target = "doctoc" | ||
} | ||
``` | ||
|
||
```yaml | ||
jobs: | ||
prepare: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
targets: ${{ steps.generate.outputs.targets }} | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
- | ||
name: List targets | ||
id: generate | ||
uses: docker/bake-action/subaction/list-targets@v4 | ||
with: | ||
target: validate | ||
|
||
validate: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- prepare | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: ${{ fromJson(needs.prepare.outputs.targets) }} | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
- | ||
name: Validate | ||
uses: docker/bake-action@v5 | ||
with: | ||
targets: ${{ matrix.target }} | ||
``` | ||
## Customizing | ||
### inputs | ||
| Name | Type | Description | | ||
|--------------|-------------|---------------------------------------------------------------------------------------------------------------------------------------------| | ||
| `workdir` | String | Working directory to use (defaults to `.`) | | ||
| `files` | List/CSV | List of [bake definition files](https://docs.docker.com/build/customize/bake/file-definition/) | | ||
| `target` | String | The target to use within the bake file | | ||
|
||
### outputs | ||
|
||
The following outputs are available | ||
|
||
| Name | Type | Description | | ||
|------------|----------|----------------------------| | ||
| `targets` | List/CSV | List of extracted targest | |