Updated CI.yml
This commit is contained in:
27
.github/workflows/ci.yml
vendored
27
.github/workflows/ci.yml
vendored
@@ -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 }}
|
||||
Reference in New Issue
Block a user