Skip to content

overmindtech/buildkit-cache-dance -> reproducible-containers/buildkit-cache-dance #18

overmindtech/buildkit-cache-dance -> reproducible-containers/buildkit-cache-dance

overmindtech/buildkit-cache-dance -> reproducible-containers/buildkit-cache-dance #18

Workflow file for this run

---
name: Build
on:
push:
branches:
- master
- 'release/**'
pull_request:
jobs:
example-archlinux:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v2
- uses: docker/metadata-action@v4
id: meta
with:
images: example-archlinux
- name: Cache var-cache-pacman
uses: actions/cache@v3
with:
path: var-cache-pacman
key: var-cache-pacman-${{ hashFiles('Dockerfile.archlinux') }}
- name: inject var-cache-pacman into docker
uses: reproducible-containers/buildkit-cache-dance/[email protected]
with:
cache-source: var-cache-pacman
cache-target: /var/cache/pacman
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
file: Dockerfile.archlinux
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: extract var-cache-pacman from docker
uses: reproducible-containers/buildkit-cache-dance/[email protected]
with:
cache-source: var-cache-pacman
cache-target: /var/cache/pacman
example-debian:
runs-on: ubuntu-22.04
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
dockerfile:
- "Dockerfile.debian-11"
- "Dockerfile.debian-12"
- "Dockerfile.ubuntu-2204"
- "Dockerfile.ubuntu-2304"
- "alternative/Dockerfile.debian-13"
- "alternative/Dockerfile.ubuntu-2310"
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v2
- uses: docker/metadata-action@v4
id: meta
with:
images: example-debian
- name: Cache var-cache-apt
uses: actions/cache@v3
with:
path: var-cache-apt
key: var-cache-apt-${{ hashFiles(format('{0}', matrix.dockerfile)) }}
- name: Cache var-lib-apt
uses: actions/cache@v3
with:
path: var-lib-apt
key: var-lib-apt-${{ hashFiles(format('{0}', matrix.dockerfile)) }}
- name: inject var-cache-apt into docker
uses: reproducible-containers/buildkit-cache-dance/[email protected]
with:
cache-source: var-cache-apt
cache-target: /var/cache/apt
- name: inject var-lib-apt into docker
uses: reproducible-containers/buildkit-cache-dance/[email protected]
with:
cache-source: var-lib-apt
cache-target: /var/lib/apt
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
file: ${{ matrix.dockerfile }}
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: extract var-cache-apt from docker
uses: reproducible-containers/buildkit-cache-dance/[email protected]
with:
cache-source: var-cache-apt
cache-target: /var/cache/apt
- name: extract var-lib-apt from docker
uses: reproducible-containers/buildkit-cache-dance/[email protected]
with:
cache-source: var-lib-apt
cache-target: /var/lib/apt