feat: Use caching in pipeline
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -64,3 +64,6 @@ legalconsenthub/.api-client-middleware
|
||||
### TestContainers persistent data ###
|
||||
legalconsenthub-backend/postgres-data/
|
||||
|
||||
### Docker BuildKit cache ###
|
||||
.buildx-cache/
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user