Merge pull request #5 from AkihiroSuda/dev #10
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
--- | |
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: | |
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: 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: ${{ matrix.dockerfile }} | |
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 |