-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
43 additions
and
23 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,51 @@ | ||
name: C/C++ CI docker | ||
name: Build docker | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
include: | ||
- image: ubuntu:24.04 | ||
label: arm64 | ||
platform: linux/arm64 | ||
- image: balenalib/raspberry-pi | ||
label: armv6l | ||
platform: linux/arm/v6 | ||
- image: balenalib/raspberry-pi2 | ||
label: armv7 | ||
platform: linux/arm/v7 | ||
- image: ubuntu:24.04 | ||
label: amd64 | ||
platform: linux/amd64 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
id-token: write | ||
packages: write | ||
contents: read | ||
attestations: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: git fetch --prune --unshallow --tags | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/${{ github.repository }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
id: setup | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
id: push | ||
with: | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6 | ||
|
||
- name: Build an image from Dockerfile | ||
run: | | ||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | ||
docker build -t docker.io/${{ github.repository }}:${{ matrix.label }} --platform ${{ matrix.platform }} --build-arg IMAGE=${{ matrix.image }} . | ||
- name: Attest | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-name: ghcr.io/${{ github.repository }} | ||
subject-digest: ${{ steps.push.outputs.digest }} | ||
push-to-registry: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ARG IMAGE=ubuntu:24.04 | ||
ARG IMAGE=debian:trixie | ||
FROM $IMAGE AS builder | ||
LABEL maintainer [email protected] | ||
Check warning on line 3 in Dockerfile GitHub Actions / buildLegacy key/value format with whitespace separator should not be used
|
||
WORKDIR /v4l2rtspserver | ||
|