Skip to content

Commit

Permalink
Merge pull request #192 from crazy-max/ci-multi-output
Browse files Browse the repository at this point in the history
ci: test multi output
  • Loading branch information
crazy-max authored Mar 12, 2024
2 parents 2930c78 + 9c020d8 commit 7ea090d
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -442,3 +442,86 @@ jobs:
source: "{{defaultContext}}"
files: |
cwd://${{ steps.meta.outputs.bake-file }}
multi-output:
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
# TODO: use buildx-stable-1 image when v0.13 promoted
driver-opts: |
image=moby/buildkit:v0.13.0
network=host
-
name: Build and push
uses: ./
with:
workdir: ./test/go
set: |
*.output=type=image,name=localhost:5000/name/app:latest,push=true
*.output=type=docker,name=app:local
*.output=type=oci,dest=/tmp/oci.tar
-
name: Check registry
run: |
docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .}}'
-
name: Check docker
run: |
docker image inspect app:local
-
name: Check oci
run: |
set -ex
mkdir -p /tmp/oci-out
tar xf /tmp/oci.tar -C /tmp/oci-out
tree -nh /tmp/oci-out
load-and-push:
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
# TODO: use buildx-stable-1 image when v0.13 promoted
driver-opts: |
image=moby/buildkit:v0.13.0
network=host
-
name: Build and push
uses: ./
with:
workdir: ./test/go
load: true
push: true
set: |
*.tags=localhost:5000/name/app:latest
-
name: Check registry
run: |
docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .}}'
-
name: Check docker
run: |
docker image inspect localhost:5000/name/app:latest

0 comments on commit 7ea090d

Please sign in to comment.