Use docker layer cache

This commit is contained in:
Eugene Dementyev
2023-08-08 19:00:55 +12:00
parent 36b15f1544
commit 2edb3f66e1
2 changed files with 5 additions and 0 deletions

View File

@@ -58,6 +58,7 @@ jobs:
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}/${{ env.PROJECT }}-${{ env.STACK }}
VERSION: ${{ env.VERSION }}
CACHE: type=gha
with:
push: true
files: |

View File

@@ -1,6 +1,7 @@
// docker-bake.hcl
variable "REGISTRY" { default = "" }
variable "VERSION" { default = "latest" }
variable "CACHE" { default = "" }
group "default" {
targets = ["app", "app-httpd"]
@@ -29,6 +30,9 @@ target "app" {
secret = [
"type=file,id=composer_auth,src=./composer-auth.json"
]
cache-from = notequal("", CACHE) ? ["${CACHE}"] : []
cache-to = notequal("", CACHE) ? ["${CACHE},mode=max,ignore-error=true"] : []
}
target "app-httpd" {