Skip to content

Merge pull request #3 from AkihiroSuda/dev #5

Merge pull request #3 from AkihiroSuda/dev

Merge pull request #3 from AkihiroSuda/dev #5

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: overmindtech/buildkit-cache-dance/inject@306d31a77191f643c0c4a95083f36c6ddccb4a16
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: overmindtech/buildkit-cache-dance/extract@306d31a77191f643c0c4a95083f36c6ddccb4a16
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:
debian-version: ["11", "12"]
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('Dockerfile.debian-{0}', matrix.debian-version)) }}
- name: Cache var-lib-apt
uses: actions/cache@v3
with:
path: var-lib-apt
key: var-lib-apt-${{ hashFiles(format('Dockerfile.debian-{0}', matrix.debian-version)) }}
- name: inject var-cache-apt into docker
uses: overmindtech/buildkit-cache-dance/inject@306d31a77191f643c0c4a95083f36c6ddccb4a16
with:
cache-source: var-cache-apt
cache-target: /var/cache/apt
- name: inject var-lib-apt into docker
uses: overmindtech/buildkit-cache-dance/inject@306d31a77191f643c0c4a95083f36c6ddccb4a16
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: Dockerfile.debian-${{ matrix.debian-version }}
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: extract var-cache-apt from docker
uses: overmindtech/buildkit-cache-dance/extract@306d31a77191f643c0c4a95083f36c6ddccb4a16
with:
cache-source: var-cache-apt
cache-target: /var/cache/apt
- name: extract var-lib-apt from docker
uses: overmindtech/buildkit-cache-dance/extract@306d31a77191f643c0c4a95083f36c6ddccb4a16
with:
cache-source: var-lib-apt
cache-target: /var/lib/apt