feat: Use caching in pipeline

This commit is contained in:
2025-12-06 19:24:39 +01:00
parent 248370a3f9
commit d441159560
2 changed files with 45 additions and 37 deletions

3
.gitignore vendored
View File

@@ -64,3 +64,6 @@ legalconsenthub/.api-client-middleware
### TestContainers persistent data ###
legalconsenthub-backend/postgres-data/
### Docker BuildKit cache ###
.buildx-cache/

View File

@@ -155,6 +155,8 @@ frontend_job() {
--tag "gitea.lugnas.de/denis/legalconsenthub:latest" \
--tag "gitea.lugnas.de/denis/legalconsenthub:$GIT_SHA" \
--file ./Dockerfile \
--cache-from type=local,src="$SCRIPT_DIR/.buildx-cache/frontend" \
--cache-to type=local,dest="$SCRIPT_DIR/.buildx-cache/frontend",mode=max \
--push \
..
if [ $? -ne 0 ]; then
@@ -209,11 +211,14 @@ backend_job() {
log_success "Tests passed"
log_info "Building Docker image..."
mkdir -p "$SCRIPT_DIR/.buildx-cache/backend"
docker buildx build \
--platform linux/amd64 \
--tag "gitea.lugnas.de/denis/legalconsenthub-backend:latest" \
--tag "gitea.lugnas.de/denis/legalconsenthub-backend:$GIT_SHA" \
--file ./Dockerfile \
--cache-from type=local,src="$SCRIPT_DIR/.buildx-cache/backend" \
--cache-to type=local,dest="$SCRIPT_DIR/.buildx-cache/backend",mode=max \
--push \
..
if [ $? -ne 0 ]; then