Docker #1008
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: Docker | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
push: | |
branches: | |
- master | |
paths: | |
- ".github/workflows/docker.yml" | |
- "docker/**" | |
pull_request: | |
branches: | |
- master | |
paths: | |
- ".github/workflows/docker.yml" | |
- "docker/**" | |
jobs: | |
docker-debian11-amd64: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Config | |
id: docker-build-config | |
env: | |
JOB: ${{ github.job }} | |
REPO: ${{ github.repository }} | |
run: | | |
set -e | |
echo "TAG=$REPO-build-$(cut -d- -f2 <<< "$JOB")" >> "$GITHUB_OUTPUT" | |
cut -d- -f2 <<< "$JOB" \ | |
| sed 's/\([0-9]\)/:\1/' \ | |
| sed 's/\([0-9][0-9]\)\([0-9]\)/\1\.\2/' \ | |
| sed 's/^/BASE_IMAGE=/' >> "$GITHUB_OUTPUT" | |
echo "ARCH=$(cut -d- -f3 <<< "$JOB")" >> "$GITHUB_OUTPUT" | |
- name: Auth | |
run: | | |
scripts/auth_github_ssh.sh | |
- name: Fetch submodules | |
run: | | |
GIT_SSH_COMMAND='ssh -vvv' git submodule update --init --jobs 10 --recursive | |
- name: Build | |
env: | |
ARCH: ${{ steps.docker-build-config.outputs.ARCH }} | |
BASE_IMAGE: ${{ steps.docker-build-config.outputs.BASE_IMAGE }} | |
TAG: ${{ steps.docker-build-config.outputs.TAG }} | |
run: | | |
set -e | |
git submodule foreach --recursive -q pwd \ | |
| cat <(pwd) - \ | |
| sed -n 's/\(\/cris\-core\)\/*$/\1/p' \ | |
| xargs -I{} find {} -maxdepth 1 -name docker -type d \ | |
| sort -u \ | |
| head -n1 \ | |
| xargs -I{} docker build \ | |
--platform "linux/$ARCH" \ | |
--build-arg "BASE_IMAGE=$BASE_IMAGE" \ | |
--no-cache \ | |
--pull \ | |
--rm \ | |
-t "ghcr.io/$TAG:ci-$ARCH" \ | |
{} | |
- name: Login to ghcr.io | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: ${{ github.event_name != 'pull_request' }} | |
run: docker login ghcr.io -u "$GITHUB_ACTOR" -p "$GITHUB_TOKEN" | |
- name: Push | |
env: | |
ARCH: ${{ steps.docker-build-config.outputs.ARCH }} | |
TAG: ${{ steps.docker-build-config.outputs.TAG }} | |
if: ${{ github.event_name != 'pull_request' }} | |
run: docker push "ghcr.io/$TAG:ci-$ARCH" | |
docker-debian11-arm64: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Config | |
id: docker-build-config | |
env: | |
JOB: ${{ github.job }} | |
REPO: ${{ github.repository }} | |
run: | | |
set -e | |
echo "TAG=$REPO-build-$(cut -d- -f2 <<< "$JOB")" >> "$GITHUB_OUTPUT" | |
cut -d- -f2 <<< "$JOB" \ | |
| sed 's/\([0-9]\)/:\1/' \ | |
| sed 's/\([0-9][0-9]\)\([0-9]\)/\1\.\2/' \ | |
| sed 's/^/BASE_IMAGE=/' >> "$GITHUB_OUTPUT" | |
echo "ARCH=$(cut -d- -f3 <<< "$JOB")" >> "$GITHUB_OUTPUT" | |
- name: Auth | |
run: | | |
scripts/auth_github_ssh.sh | |
- name: Fetch submodules | |
run: | | |
GIT_SSH_COMMAND='ssh -vvv' git submodule update --init --jobs 10 --recursive | |
- uses: docker/setup-qemu-action@v3 | |
- name: Build | |
env: | |
ARCH: ${{ steps.docker-build-config.outputs.ARCH }} | |
BASE_IMAGE: ${{ steps.docker-build-config.outputs.BASE_IMAGE }} | |
TAG: ${{ steps.docker-build-config.outputs.TAG }} | |
run: | | |
set -e | |
git submodule foreach --recursive -q pwd \ | |
| cat <(pwd) - \ | |
| sed -n 's/\(\/cris\-core\)\/*$/\1/p' \ | |
| xargs -I{} find {} -maxdepth 1 -name docker -type d \ | |
| sort -u \ | |
| head -n1 \ | |
| xargs -I{} docker build \ | |
--platform "linux/$ARCH" \ | |
--build-arg "BASE_IMAGE=$BASE_IMAGE" \ | |
--no-cache \ | |
--pull \ | |
--rm \ | |
-t "ghcr.io/$TAG:ci-$ARCH" \ | |
{} | |
- name: Login to ghcr.io | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: ${{ github.event_name != 'pull_request' }} | |
run: docker login ghcr.io -u "$GITHUB_ACTOR" -p "$GITHUB_TOKEN" | |
- name: Push | |
env: | |
ARCH: ${{ steps.docker-build-config.outputs.ARCH }} | |
TAG: ${{ steps.docker-build-config.outputs.TAG }} | |
if: ${{ github.event_name != 'pull_request' }} | |
run: docker push "ghcr.io/$TAG:ci-$ARCH" | |
docker-debian12-amd64: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Config | |
id: docker-build-config | |
env: | |
JOB: ${{ github.job }} | |
REPO: ${{ github.repository }} | |
run: | | |
set -e | |
echo "TAG=$REPO-build-$(cut -d- -f2 <<< "$JOB")" >> "$GITHUB_OUTPUT" | |
cut -d- -f2 <<< "$JOB" \ | |
| sed 's/\([0-9]\)/:\1/' \ | |
| sed 's/\([0-9][0-9]\)\([0-9]\)/\1\.\2/' \ | |
| sed 's/^/BASE_IMAGE=/' >> "$GITHUB_OUTPUT" | |
echo "ARCH=$(cut -d- -f3 <<< "$JOB")" >> "$GITHUB_OUTPUT" | |
- name: Auth | |
run: | | |
scripts/auth_github_ssh.sh | |
- name: Fetch submodules | |
run: | | |
GIT_SSH_COMMAND='ssh -vvv' git submodule update --init --jobs 10 --recursive | |
- name: Build | |
env: | |
ARCH: ${{ steps.docker-build-config.outputs.ARCH }} | |
BASE_IMAGE: ${{ steps.docker-build-config.outputs.BASE_IMAGE }} | |
TAG: ${{ steps.docker-build-config.outputs.TAG }} | |
run: | | |
set -e | |
git submodule foreach --recursive -q pwd \ | |
| cat <(pwd) - \ | |
| sed -n 's/\(\/cris\-core\)\/*$/\1/p' \ | |
| xargs -I{} find {} -maxdepth 1 -name docker -type d \ | |
| sort -u \ | |
| head -n1 \ | |
| xargs -I{} docker build \ | |
--platform "linux/$ARCH" \ | |
--build-arg "BASE_IMAGE=$BASE_IMAGE" \ | |
--no-cache \ | |
--pull \ | |
--rm \ | |
-t "ghcr.io/$TAG:ci-$ARCH" \ | |
{} | |
- name: Login to ghcr.io | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: ${{ github.event_name != 'pull_request' }} | |
run: docker login ghcr.io -u "$GITHUB_ACTOR" -p "$GITHUB_TOKEN" | |
- name: Push | |
env: | |
ARCH: ${{ steps.docker-build-config.outputs.ARCH }} | |
TAG: ${{ steps.docker-build-config.outputs.TAG }} | |
if: ${{ github.event_name != 'pull_request' }} | |
run: docker push "ghcr.io/$TAG:ci-$ARCH" | |
docker-debian12-arm64: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Config | |
id: docker-build-config | |
env: | |
JOB: ${{ github.job }} | |
REPO: ${{ github.repository }} | |
run: | | |
set -e | |
echo "TAG=$REPO-build-$(cut -d- -f2 <<< "$JOB")" >> "$GITHUB_OUTPUT" | |
cut -d- -f2 <<< "$JOB" \ | |
| sed 's/\([0-9]\)/:\1/' \ | |
| sed 's/\([0-9][0-9]\)\([0-9]\)/\1\.\2/' \ | |
| sed 's/^/BASE_IMAGE=/' >> "$GITHUB_OUTPUT" | |
echo "ARCH=$(cut -d- -f3 <<< "$JOB")" >> "$GITHUB_OUTPUT" | |
- name: Auth | |
run: | | |
scripts/auth_github_ssh.sh | |
- name: Fetch submodules | |
run: | | |
GIT_SSH_COMMAND='ssh -vvv' git submodule update --init --jobs 10 --recursive | |
- uses: docker/setup-qemu-action@v3 | |
- name: Build | |
env: | |
ARCH: ${{ steps.docker-build-config.outputs.ARCH }} | |
BASE_IMAGE: ${{ steps.docker-build-config.outputs.BASE_IMAGE }} | |
TAG: ${{ steps.docker-build-config.outputs.TAG }} | |
run: | | |
set -e | |
git submodule foreach --recursive -q pwd \ | |
| cat <(pwd) - \ | |
| sed -n 's/\(\/cris\-core\)\/*$/\1/p' \ | |
| xargs -I{} find {} -maxdepth 1 -name docker -type d \ | |
| sort -u \ | |
| head -n1 \ | |
| xargs -I{} docker build \ | |
--platform "linux/$ARCH" \ | |
--build-arg "BASE_IMAGE=$BASE_IMAGE" \ | |
--no-cache \ | |
--pull \ | |
--rm \ | |
-t "ghcr.io/$TAG:ci-$ARCH" \ | |
{} | |
- name: Login to ghcr.io | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: ${{ github.event_name != 'pull_request' }} | |
run: docker login ghcr.io -u "$GITHUB_ACTOR" -p "$GITHUB_TOKEN" | |
- name: Push | |
env: | |
ARCH: ${{ steps.docker-build-config.outputs.ARCH }} | |
TAG: ${{ steps.docker-build-config.outputs.TAG }} | |
if: ${{ github.event_name != 'pull_request' }} | |
run: docker push "ghcr.io/$TAG:ci-$ARCH" | |
docker-ubuntu2204-amd64: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Config | |
id: docker-build-config | |
env: | |
JOB: ${{ github.job }} | |
REPO: ${{ github.repository }} | |
run: | | |
set -e | |
echo "TAG=$REPO-build-$(cut -d- -f2 <<< "$JOB")" >> "$GITHUB_OUTPUT" | |
cut -d- -f2 <<< "$JOB" \ | |
| sed 's/\([0-9]\)/:\1/' \ | |
| sed 's/\([0-9][0-9]\)\([0-9]\)/\1\.\2/' \ | |
| sed 's/^/BASE_IMAGE=/' >> "$GITHUB_OUTPUT" | |
echo "ARCH=$(cut -d- -f3 <<< "$JOB")" >> "$GITHUB_OUTPUT" | |
- name: Auth | |
run: | | |
scripts/auth_github_ssh.sh | |
- name: Fetch submodules | |
run: | | |
GIT_SSH_COMMAND='ssh -vvv' git submodule update --init --jobs 10 --recursive | |
- name: Build | |
env: | |
ARCH: ${{ steps.docker-build-config.outputs.ARCH }} | |
BASE_IMAGE: ${{ steps.docker-build-config.outputs.BASE_IMAGE }} | |
TAG: ${{ steps.docker-build-config.outputs.TAG }} | |
run: | | |
set -e | |
git submodule foreach --recursive -q pwd \ | |
| cat <(pwd) - \ | |
| sed -n 's/\(\/cris\-core\)\/*$/\1/p' \ | |
| xargs -I{} find {} -maxdepth 1 -name docker -type d \ | |
| sort -u \ | |
| head -n1 \ | |
| xargs -I{} docker build \ | |
--platform "linux/$ARCH" \ | |
--build-arg "BASE_IMAGE=$BASE_IMAGE" \ | |
--no-cache \ | |
--pull \ | |
--rm \ | |
-t "ghcr.io/$TAG:ci-$ARCH" \ | |
{} | |
- name: Login to ghcr.io | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: ${{ github.event_name != 'pull_request' }} | |
run: docker login ghcr.io -u "$GITHUB_ACTOR" -p "$GITHUB_TOKEN" | |
- name: Push | |
env: | |
ARCH: ${{ steps.docker-build-config.outputs.ARCH }} | |
TAG: ${{ steps.docker-build-config.outputs.TAG }} | |
if: ${{ github.event_name != 'pull_request' }} | |
run: docker push "ghcr.io/$TAG:ci-$ARCH" | |
docker-ubuntu2204-arm64: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Config | |
id: docker-build-config | |
env: | |
JOB: ${{ github.job }} | |
REPO: ${{ github.repository }} | |
run: | | |
set -e | |
echo "TAG=$REPO-build-$(cut -d- -f2 <<< "$JOB")" >> "$GITHUB_OUTPUT" | |
cut -d- -f2 <<< "$JOB" \ | |
| sed 's/\([0-9]\)/:\1/' \ | |
| sed 's/\([0-9][0-9]\)\([0-9]\)/\1\.\2/' \ | |
| sed 's/^/BASE_IMAGE=/' >> "$GITHUB_OUTPUT" | |
echo "ARCH=$(cut -d- -f3 <<< "$JOB")" >> "$GITHUB_OUTPUT" | |
- name: Auth | |
run: | | |
scripts/auth_github_ssh.sh | |
- name: Fetch submodules | |
run: | | |
GIT_SSH_COMMAND='ssh -vvv' git submodule update --init --jobs 10 --recursive | |
- uses: docker/setup-qemu-action@v3 | |
- name: Build | |
env: | |
ARCH: ${{ steps.docker-build-config.outputs.ARCH }} | |
BASE_IMAGE: ${{ steps.docker-build-config.outputs.BASE_IMAGE }} | |
TAG: ${{ steps.docker-build-config.outputs.TAG }} | |
run: | | |
set -e | |
git submodule foreach --recursive -q pwd \ | |
| cat <(pwd) - \ | |
| sed -n 's/\(\/cris\-core\)\/*$/\1/p' \ | |
| xargs -I{} find {} -maxdepth 1 -name docker -type d \ | |
| sort -u \ | |
| head -n1 \ | |
| xargs -I{} docker build \ | |
--platform "linux/$ARCH" \ | |
--build-arg "BASE_IMAGE=$BASE_IMAGE" \ | |
--no-cache \ | |
--pull \ | |
--rm \ | |
-t "ghcr.io/$TAG:ci-$ARCH" \ | |
{} | |
- name: Login to ghcr.io | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: ${{ github.event_name != 'pull_request' }} | |
run: docker login ghcr.io -u "$GITHUB_ACTOR" -p "$GITHUB_TOKEN" | |
- name: Push | |
env: | |
ARCH: ${{ steps.docker-build-config.outputs.ARCH }} | |
TAG: ${{ steps.docker-build-config.outputs.TAG }} | |
if: ${{ github.event_name != 'pull_request' }} | |
run: docker push "ghcr.io/$TAG:ci-$ARCH" | |
docker-ubuntu2404-amd64: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Config | |
id: docker-build-config | |
env: | |
JOB: ${{ github.job }} | |
REPO: ${{ github.repository }} | |
run: | | |
set -e | |
echo "TAG=$REPO-build-$(cut -d- -f2 <<< "$JOB")" >> "$GITHUB_OUTPUT" | |
cut -d- -f2 <<< "$JOB" \ | |
| sed 's/\([0-9]\)/:\1/' \ | |
| sed 's/\([0-9][0-9]\)\([0-9]\)/\1\.\2/' \ | |
| sed 's/^/BASE_IMAGE=/' >> "$GITHUB_OUTPUT" | |
echo "ARCH=$(cut -d- -f3 <<< "$JOB")" >> "$GITHUB_OUTPUT" | |
- name: Auth | |
run: | | |
scripts/auth_github_ssh.sh | |
- name: Fetch submodules | |
run: | | |
GIT_SSH_COMMAND='ssh -vvv' git submodule update --init --jobs 10 --recursive | |
- name: Build | |
env: | |
ARCH: ${{ steps.docker-build-config.outputs.ARCH }} | |
BASE_IMAGE: ${{ steps.docker-build-config.outputs.BASE_IMAGE }} | |
TAG: ${{ steps.docker-build-config.outputs.TAG }} | |
run: | | |
set -e | |
git submodule foreach --recursive -q pwd \ | |
| cat <(pwd) - \ | |
| sed -n 's/\(\/cris\-core\)\/*$/\1/p' \ | |
| xargs -I{} find {} -maxdepth 1 -name docker -type d \ | |
| sort -u \ | |
| head -n1 \ | |
| xargs -I{} docker build \ | |
--platform "linux/$ARCH" \ | |
--build-arg "BASE_IMAGE=$BASE_IMAGE" \ | |
--no-cache \ | |
--pull \ | |
--rm \ | |
-t "ghcr.io/$TAG:ci-$ARCH" \ | |
{} | |
- name: Login to ghcr.io | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: ${{ github.event_name != 'pull_request' }} | |
run: docker login ghcr.io -u "$GITHUB_ACTOR" -p "$GITHUB_TOKEN" | |
- name: Push | |
env: | |
ARCH: ${{ steps.docker-build-config.outputs.ARCH }} | |
TAG: ${{ steps.docker-build-config.outputs.TAG }} | |
if: ${{ github.event_name != 'pull_request' }} | |
run: docker push "ghcr.io/$TAG:ci-$ARCH" | |
docker-ubuntu2404-arm64: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Config | |
id: docker-build-config | |
env: | |
JOB: ${{ github.job }} | |
REPO: ${{ github.repository }} | |
run: | | |
set -e | |
echo "TAG=$REPO-build-$(cut -d- -f2 <<< "$JOB")" >> "$GITHUB_OUTPUT" | |
cut -d- -f2 <<< "$JOB" \ | |
| sed 's/\([0-9]\)/:\1/' \ | |
| sed 's/\([0-9][0-9]\)\([0-9]\)/\1\.\2/' \ | |
| sed 's/^/BASE_IMAGE=/' >> "$GITHUB_OUTPUT" | |
echo "ARCH=$(cut -d- -f3 <<< "$JOB")" >> "$GITHUB_OUTPUT" | |
- name: Auth | |
run: | | |
scripts/auth_github_ssh.sh | |
- name: Fetch submodules | |
run: | | |
GIT_SSH_COMMAND='ssh -vvv' git submodule update --init --jobs 10 --recursive | |
- uses: docker/setup-qemu-action@v3 | |
- name: Build | |
env: | |
ARCH: ${{ steps.docker-build-config.outputs.ARCH }} | |
BASE_IMAGE: ${{ steps.docker-build-config.outputs.BASE_IMAGE }} | |
TAG: ${{ steps.docker-build-config.outputs.TAG }} | |
run: | | |
set -e | |
git submodule foreach --recursive -q pwd \ | |
| cat <(pwd) - \ | |
| sed -n 's/\(\/cris\-core\)\/*$/\1/p' \ | |
| xargs -I{} find {} -maxdepth 1 -name docker -type d \ | |
| sort -u \ | |
| head -n1 \ | |
| xargs -I{} docker build \ | |
--platform "linux/$ARCH" \ | |
--build-arg "BASE_IMAGE=$BASE_IMAGE" \ | |
--no-cache \ | |
--pull \ | |
--rm \ | |
-t "ghcr.io/$TAG:ci-$ARCH" \ | |
{} | |
- name: Login to ghcr.io | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: ${{ github.event_name != 'pull_request' }} | |
run: docker login ghcr.io -u "$GITHUB_ACTOR" -p "$GITHUB_TOKEN" | |
- name: Push | |
env: | |
ARCH: ${{ steps.docker-build-config.outputs.ARCH }} | |
TAG: ${{ steps.docker-build-config.outputs.TAG }} | |
if: ${{ github.event_name != 'pull_request' }} | |
run: docker push "ghcr.io/$TAG:ci-$ARCH" | |