diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 466702a..8616179 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,11 +15,13 @@ jobs: with: images: test - name: Cache var-cache-apt + id: cache-var-cache-apt uses: actions/cache@v3 with: path: var-cache-apt key: var-cache-apt-${{ hashFiles('.github/workflows/test/Dockerfile') }} - name: Cache var-lib-apt + id: cache-var-lib-apt uses: actions/cache@v3 with: path: var-lib-apt @@ -34,6 +36,7 @@ jobs: with: cache-source: var-lib-apt cache-target: /var/lib/apt + skip-extraction: ${{ steps.cache-var-lib-apt.outputs.cache-hit }} - name: Build and push uses: docker/build-push-action@v5 with: diff --git a/action.yml b/action.yml index 4920d6c..23344c0 100644 --- a/action.yml +++ b/action.yml @@ -10,6 +10,9 @@ inputs: scratch-dir: default: scratch description: "Where the action is stores some temporary files for its processing. Default: `scratch`" + skip-extraction: + default: "false" + description: "Skip the extraction of the cache from the docker container" runs: using: 'node20' main: 'entrypoint.js' diff --git a/post b/post index e695599..d54e6de 100755 --- a/post +++ b/post @@ -5,6 +5,12 @@ dir="$(dirname "$0")" read_action_input() { "${dir}/read-action-input" "$1" } + +if [ "$(read_action_input skip-extraction)" == "true" ]; then + echo "skip-extraction is set. Skipping extraction step..." >&2 + exit 0 +fi + : "Prepare Timestamp for Layer Cache Busting" date --iso=ns | tee "$(read_action_input scratch-dir)"/buildstamp : "Prepare Dancefile to Access Caches"