mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 08:27:32 +00:00
use cache
This commit is contained in:
22
.github/workflows/test.yml
vendored
22
.github/workflows/test.yml
vendored
@@ -10,18 +10,28 @@ jobs:
|
|||||||
contents: "read"
|
contents: "read"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
ghcr.io/zitadel/login
|
||||||
|
tags: |
|
||||||
|
type=ref,event=branch
|
||||||
|
type=ref,event=pr
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
labels: |
|
||||||
|
git-branch={{branch}}
|
||||||
- name: Set up persistent Buildx builder
|
- name: Set up persistent Buildx builder
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
|
||||||
install: true
|
|
||||||
driver: docker-container
|
|
||||||
use: true
|
|
||||||
- name: Build
|
- name: Build
|
||||||
uses: docker/bake-action@v6
|
uses: docker/bake-action@v6
|
||||||
|
env:
|
||||||
|
GIT_BRANCH: ${{ fromJSON(steps.meta.outputs.json).labels['git-branch'] }}
|
||||||
with:
|
with:
|
||||||
source: .
|
source: .
|
||||||
push: false
|
push: false
|
||||||
builder: ${{ steps.buildx.outputs.name }}
|
|
||||||
load: true
|
|
||||||
targets: login-lint
|
targets: login-lint
|
||||||
|
@@ -1,14 +1,10 @@
|
|||||||
group "default" {
|
target "docker-metadata-action" {}
|
||||||
targets = [
|
|
||||||
"login-lint",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "REGISTRY" {
|
variable "IMAGE_REGISTRY" {
|
||||||
default = "ghcr.io/zitadel"
|
default = "ghcr.io/zitadel"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "GITHUB_REF_NAME" {
|
variable "GIT_BRANCH" {
|
||||||
default = "local"
|
default = "local"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,10 +28,10 @@ target "login-lint" {
|
|||||||
login-dev-base = "target:login-dev-base"
|
login-dev-base = "target:login-dev-base"
|
||||||
}
|
}
|
||||||
cache-from = [
|
cache-from = [
|
||||||
"type=registry,ref=${REGISTRY}/login-lint-buildcache:${GITHUB_REF_NAME}",
|
"type=registry,ref=${IMAGE_REGISTRY}/login-lint-buildcache:${GIT_BRANCH}",
|
||||||
"type=registry,ref=${REGISTRY}/login-lint-buildcache:main"
|
"type=registry,ref=${IMAGE_REGISTRY}/login-lint-buildcache:main"
|
||||||
]
|
]
|
||||||
cache-to = ["type=registry,ref=${REGISTRY}/login-lint-buildcache:${GITHUB_REF_NAME},mode=max"]
|
cache-to = ["type=registry,ref=${IMAGE_REGISTRY}/login-lint-buildcache:${GIT_BRANCH},mode=max"]
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "LOGIN_TEST_UNIT_TAG" {
|
variable "LOGIN_TEST_UNIT_TAG" {
|
||||||
|
Reference in New Issue
Block a user