Skip to content

Commit

Permalink
ci: use native arm64 runner and cache build layers
Browse files Browse the repository at this point in the history
  • Loading branch information
SamyDjemai committed Nov 8, 2024
1 parent 4d1d791 commit 9a1e5c9
Showing 1 changed file with 45 additions and 2 deletions.
47 changes: 45 additions & 2 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker build and push
name: Docker

on:
pull_request:
Expand All @@ -15,7 +15,50 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
docker-build-and-push:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64

permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and cache Docker image
id: push
uses: docker/build-push-action@v6
with:
context: .
platforms: ${{ matrix.platform }}
cache-from: type=gha
cache-to: type=gha,mode=max
push: false

push:
needs: build
runs-on: ubuntu-latest

permissions:
Expand Down

0 comments on commit 9a1e5c9

Please sign in to comment.