Add isolated builders example

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2020-08-29 17:46:56 +02:00
parent 8954ded19b
commit bd6a01893d
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7

View file

@ -18,6 +18,7 @@ ___
* [Usage](#usage)
* [Quick start](#quick-start)
* [Isolated builders](#isolated-builders)
* [Multi-platform image](#multi-platform-image)
* [Git context](#git-context)
* [Leverage GitHub cache](#leverage-github-cache)
@ -80,6 +81,48 @@ jobs:
run: echo ${{ steps.docker_build.outputs.digest }}
```
### Isolated builders
```yaml
name: ci
on:
push:
branches: master
jobs:
multi-builders:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
uses: docker/setup-buildx-action@master
id: builder1
-
uses: docker/setup-buildx-action@master
id: builder2
-
name: Builder 1 name
run: echo ${{ steps.builder1.outputs.name }}
-
name: Builder 2 name
run: echo ${{ steps.builder2.outputs.name }}
-
name: Build against builder1
uses: docker/build-push-action@v2
with:
builder: ${{ steps.builder1.outputs.name }}
target: mytarget1
-
name: Build against builder2
uses: docker/build-push-action@v2
with:
builder: ${{ steps.builder2.outputs.name }}
target: mytarget2
```
### Multi-platform image
```yaml
@ -186,7 +229,7 @@ on:
branches: master
jobs:
main:
github-cache:
runs-on: ubuntu-latest
steps:
-