add local cache
This commit is contained in:
parent
e5d8a2a82d
commit
7b4afe864f
1 changed files with 20 additions and 1 deletions
19
action.yaml
19
action.yaml
|
|
@ -32,17 +32,35 @@ inputs:
|
||||||
description: 'Optional build arguments separated by spaces or newlines (e.g., KEY=VAL)'
|
description: 'Optional build arguments separated by spaces or newlines (e.g., KEY=VAL)'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
|
multi_stage_caching:
|
||||||
|
description: 'Enforce cache elision feature flags at the binary execution layer'
|
||||||
|
required: false
|
||||||
|
default: 'true'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: 'composite'
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
- name: Cache Kaniko Layers Locally
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ${{ forgejo.workspace }}/.kaniko-local-cache
|
||||||
|
key: kaniko-cache-${{ hashFiles('**/composer.lock', '**/Dockerfile') }}
|
||||||
|
restore-keys: |
|
||||||
|
kaniko-cache-
|
||||||
|
|
||||||
- name: Build and Push with Kaniko
|
- name: Build and Push with Kaniko
|
||||||
shell: sh
|
shell: sh
|
||||||
env:
|
env:
|
||||||
INPUT_BUILD_ARGS: ${{ inputs.build_args }}
|
INPUT_BUILD_ARGS: ${{ inputs.build_args }}
|
||||||
run: |
|
run: |
|
||||||
|
|
||||||
|
# 0. Enforce cache elision feature flags at the binary execution layer
|
||||||
|
export FF_KANIKO_SKIP_CACHED_STAGES=true
|
||||||
|
export FF_KANIKO_INFER_CROSS_STAGE_CACHE_KEY=true
|
||||||
|
export FF_KANIKO_CACHE_LOOKAHEAD=true
|
||||||
|
export FF_KANIKO_ROLLING_CACHE_KEY=true
|
||||||
|
|
||||||
# 1. Initialize Kaniko Docker config directory
|
# 1. Initialize Kaniko Docker config directory
|
||||||
mkdir -p /kaniko/.docker
|
mkdir -p /kaniko/.docker
|
||||||
|
|
||||||
|
|
@ -78,4 +96,5 @@ runs:
|
||||||
--cache=true \
|
--cache=true \
|
||||||
--use-new-run=true \
|
--use-new-run=true \
|
||||||
--snapshot-mode=redo \
|
--snapshot-mode=redo \
|
||||||
|
--cache-dir="${{ forgejo.workspace }}/.kaniko-local-cache"
|
||||||
--cache-repo="$CACHE_REPO_ARG"
|
--cache-repo="$CACHE_REPO_ARG"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue