Skip to content

Commit

Permalink
Change docker caching method
Browse files Browse the repository at this point in the history
  • Loading branch information
pvandyken committed Apr 18, 2024
1 parent d3fcba0 commit d79a2a1
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions .github/actions/build-test-container/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,22 @@ runs:
- name: Cache Template Testing Containers
uses: actions/cache@v4
with:
path: |
var-cache-apt
var-lib-apt
path: /tmp/.buildx-cache
key: ${{ runner.os }}-test-template-cache-${{ hashFiles('containers/test-template/**') }}-${{ inputs.python-version }}
- name: Inject container-test-template-cache into docker
uses: reproducible-containers/[email protected]
with:
cache-map: |
{
"var-cache-apt": "/var/cache/apt",
"var-lib-apt": "/var/lib/apt"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
- name: Build Docker container for cache
uses: docker/build-push-action@v5
with:
context: containers/test-template
cache-from: type=gha
cache-to: type=gha,mode=max
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mod=max
push: false
load: ${{ inputs.load == 'true' }}
tags: snakebids/test-template:${{ inputs.python-version }}
platforms: linux/amd64
build-args: |
PYTHON_VERSION=${{ inputs.python-version }}
- name: Move cache
shell: bash
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

0 comments on commit d79a2a1

Please sign in to comment.