Skip to content

Commit

Permalink
Merge pull request #19 from henryjw/option-to-skip-extract
Browse files Browse the repository at this point in the history
Option to skip extract step
  • Loading branch information
AkihiroSuda authored Jan 22, 2024
2 parents a7e6c84 + 9e48a3f commit 4b2444f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 6 additions & 0 deletions post
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4b2444f

Please sign in to comment.