-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: rewrite in TypeScript with CacheMap support
BREAKING `cache-source` and `cache-target` are removed in favour of `cache-map` that expects a JSON string Signed-off-by: Amin Yahyaabadi <[email protected]>
- Loading branch information
Showing
17 changed files
with
3,138 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
.parcel-cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,43 +32,39 @@ Action: | |
```yaml | ||
--- | ||
name: Build | ||
on: push | ||
on: | ||
push: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
Build: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/setup-buildx-action@v3 | ||
- uses: docker/metadata-action@v5 | ||
id: meta | ||
with: | ||
images: YOUR_IMAGE | ||
- name: Cache var-cache-apt | ||
id: cache-var-cache-apt | ||
uses: actions/cache@v3 | ||
with: | ||
path: var-cache-apt | ||
key: var-cache-apt-${{ hashFiles('Dockerfile') }} | ||
- name: Cache var-lib-apt | ||
id: cache-var-lib-apt | ||
images: Build | ||
|
||
- name: Cache | ||
uses: actions/cache@v3 | ||
id: cache | ||
with: | ||
path: var-lib-apt | ||
key: var-lib-apt-${{ hashFiles('Dockerfile') }} | ||
- name: inject var-cache-apt into docker | ||
uses: reproducible-containers/[email protected] | ||
with: | ||
cache-source: var-cache-apt | ||
cache-target: /var/cache/apt | ||
skip-extraction: ${{ steps.cache-var-cache-apt.outputs.cache-hit }} | ||
- name: inject var-lib-apt into docker | ||
uses: reproducible-containers/[email protected] | ||
path: | | ||
var-cache-apt | ||
var-lib-apt | ||
key: cache-${{ hashFiles('.github/workflows/test/Dockerfile') }} | ||
|
||
- name: inject cache into docker | ||
uses: reproducible-containers/[email protected] | ||
with: | ||
cache-source: var-lib-apt | ||
cache-target: /var/lib/apt | ||
skip-extraction: ${{ steps.cache-var-lib-apt.outputs.cache-hit }} | ||
cache-map: | | ||
{ | ||
"var-cache-apt": "/var/cache/apt", | ||
"var-lib-apt": "/var/lib/apt" | ||
} | ||
skip-extraction: ${{ steps.cache.outputs.cache-hit }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
|
@@ -79,6 +75,7 @@ jobs: | |
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
``` | ||
|
||
Real-world examples: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.