mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-13 19:09:16 +00:00
use cache
This commit is contained in:
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
@@ -22,15 +22,14 @@ jobs:
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
labels: |
|
||||
git-branch={{branch}}
|
||||
- name: Set up persistent Buildx builder
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Build
|
||||
uses: docker/bake-action@v6
|
||||
env:
|
||||
GIT_BRANCH: ${{ fromJSON(steps.meta.outputs.json).labels['git-branch'] }}
|
||||
# latest if branch is main, otherwise image version which is the pull request number
|
||||
BUILD_CACHE_KEY: "${{ github.ref == 'refs/heads/main' ? "latest" : fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}"
|
||||
with:
|
||||
source: .
|
||||
push: false
|
||||
|
@@ -4,7 +4,7 @@ variable "IMAGE_REGISTRY" {
|
||||
default = "ghcr.io/zitadel"
|
||||
}
|
||||
|
||||
variable "GIT_BRANCH" {
|
||||
variable "BUILD_CACHE_KEY" {
|
||||
default = "local"
|
||||
}
|
||||
|
||||
@@ -28,10 +28,10 @@ target "login-lint" {
|
||||
login-dev-base = "target:login-dev-base"
|
||||
}
|
||||
cache-from = [
|
||||
"type=registry,ref=${IMAGE_REGISTRY}/login-lint-buildcache:${GIT_BRANCH}",
|
||||
"type=registry,ref=${IMAGE_REGISTRY}/login-lint-buildcache:${BUILD_CACHE_KEY}",
|
||||
"type=registry,ref=${IMAGE_REGISTRY}/login-lint-buildcache:main"
|
||||
]
|
||||
cache-to = ["type=registry,ref=${IMAGE_REGISTRY}/login-lint-buildcache:${GIT_BRANCH},mode=max"]
|
||||
cache-to = ["type=registry,ref=${IMAGE_REGISTRY}/login-lint-buildcache:${BUILD_CACHE_KEY},mode=max"]
|
||||
}
|
||||
|
||||
variable "LOGIN_TEST_UNIT_TAG" {
|
||||
|
Reference in New Issue
Block a user