Skip to content

Commit

Permalink
Push each image (#2)
Browse files Browse the repository at this point in the history
* Push each image

* Fix

* Refactor

* Refactor

* Use for

* Refactor
  • Loading branch information
int128 authored Dec 8, 2024
1 parent 391ca95 commit cbec3d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: metadata
with:
images: ghcr.io/${{ github.repository }}
- uses: docker/setup-buildx-action@v3
- uses: docker/bake-action@v5
env:
TAG_BASE: ghcr.io/${{ github.repository }}
with:
push: true
files: |
./docker-bake.hcl
${{ steps.metadata.outputs.bake-file }}
8 changes: 5 additions & 3 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
variable "TAG_BASE" {}

group "default" {
targets = [
"service1",
"service2",
]
}

target "docker-metadata-action" {
output = ["type=registry"]
}
target "docker-metadata-action" {}

target "service1" {
inherits = ["docker-metadata-action"]
context = "."
dockerfile = "service1.dockerfile"
tags = [for tag in target.docker-metadata-action.tags : "${TAG_BASE}/service1:${tag}"]
}

target "service2" {
inherits = ["docker-metadata-action"]
context = "."
dockerfile = "service2.dockerfile"
tags = [for tag in target.docker-metadata-action.tags : "${TAG_BASE}/service2:${tag}"]
}

0 comments on commit cbec3d7

Please sign in to comment.