Updated CI.yml
All checks were successful
CI / Lint & Format (push) Successful in 4s
CI / Tests (Pytest + Alembic + Postgres) (push) Successful in 9m25s
CI / Docker Build (push) Successful in 1m12s

This commit is contained in:
2025-09-30 13:15:40 +01:00
parent 5e79768394
commit 48c5731a8a

View File

@@ -144,15 +144,34 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
# Detect runner flavor and pick cache mode
- name: Select Buildx cache backend
run: |
if [ "${ACT:-}" = "true" ]; then
echo "CACHE_TO=type=local,dest=/tmp/.buildx-cache,mode=max" >> $GITHUB_ENV
echo "CACHE_FROM=type=local,src=/tmp/.buildx-cache" >> $GITHUB_ENV
else
echo "CACHE_TO=type=gha,mode=max" >> $GITHUB_ENV
echo "CACHE_FROM=type=gha" >> $GITHUB_ENV
fi
# (Only needed for local cache on act_runner)
- name: Prepare local Buildx cache dir
if: ${{ env.ACT == 'true' }}
run: mkdir -p /tmp/.buildx-cache
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
# optional: helps debugging cache issues
buildkitd-flags: --debug
- name: Build image (no push)
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: keywarden:ci
# speeds up builds by caching layers on GH Actions
cache-from: type=gha
cache-to: type=gha,mode=max
push: false # or true, if you want to push
load: false # set true if you need the image in the job afterward
cache-from: ${{ env.CACHE_FROM }}
cache-to: ${{ env.CACHE_TO }}