Skip to content

store cache in S3

store cache in S3 #3

Workflow file for this run

---
name: Build
on:
push:
jobs:
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: Build
- name: Cache (S3)
uses: tespkg/actions-cache@v1
id: cache
with:
bucket: gha-docker-npm-caching-example
accessKey: ${{ vars.AWS_ACCESS_KEY }}
secretKey: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
path: |
pnpm
key: gha-cache-example/cache-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
gha-cache-example/cache-
- name: inject cache into docker
uses: reproducible-containers/[email protected]
with:
cache-map: |
{
"pnpm": "/pnpm"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
- name: Build
uses: docker/build-push-action@v5
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
file: Dockerfile
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}