Skip to content

Change build arg

Change build arg #14

name: Generate Toolchain Docker Images
on:
push:
branches:
- master
paths:
- utils/dc-chain/scripts/**
- utils/dc-chain/patches/**
- utils/dc-chain/profiles/**
- utils/dc-chain/Makefile
- utils/dc-chain/Makefile.default.cfg
- utils/dc-chain/docker/Dockerfile
permissions:
packages: write
jobs:
build-arm64:
runs-on: self-hosted
name: Build for ARM64
strategy:
matrix:
version:
- { tag: "13.3-legacy", dc_chain: "legacy" }
- { tag: "14.2-stable", dc_chain: "stable" }
- { tag: "15.0-dev", dc_chain: "dev" }
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Convert Repository Owner to Lowercase
id: lower-owner
run: |
echo "repository_owner=${GITHUB_REPOSITORY%%/*}" | tr '[:upper:]' '[:lower:]' >> $GITHUB_OUTPUT
- name: Build and Push ARM64 Docker Image
uses: docker/build-push-action@v6
with:
context: utils/dc-chain/docker
file: utils/dc-chain/docker/Dockerfile
push: true
tags: |
ghcr.io/${{ steps.lower-owner.outputs.repository_owner }}/dc-toolchain:${{ matrix.version.tag }}-arm64
${{ secrets.DOCKER_HUB_USERNAME }}/dc-toolchain:${{ matrix.version.tag }}-arm64
platforms: linux/arm64
build-args: |
dc_chain=${{ matrix.version.dc_chain }}
makejobs=8
enable_objc=0
enable_objcpp=0
no-cache: true
build-amd64:
runs-on: ubuntu-latest
name: Build for AMD64
strategy:
matrix:
version:
- { tag: "13.3-legacy", dc_chain: "legacy" }
- { tag: "14.2-stable", dc_chain: "stable" }
- { tag: "15.0-dev", dc_chain: "dev" }
needs: build-arm64
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Convert Repository Owner to Lowercase
id: lower-owner
run: |
echo "repository_owner=${GITHUB_REPOSITORY%%/*}" | tr '[:upper:]' '[:lower:]' >> $GITHUB_OUTPUT
- name: Build and Push AMD64 Docker Image
uses: docker/build-push-action@v6
with:
context: utils/dc-chain/docker
file: utils/dc-chain/docker/Dockerfile
push: true
tags: |
ghcr.io/${{ steps.lower-owner.outputs.repository_owner }}/dc-toolchain:${{ matrix.version.tag }}-amd64
${{ secrets.DOCKER_HUB_USERNAME }}/dc-toolchain:${{ matrix.version.tag }}-amd64
platforms: linux/amd64
build-args: |
dc_chain=${{ matrix.version.dc_chain }}
makejobs=8
enable_objc=0
enable_objcpp=0
no-cache: true
merge-manifest:
runs-on: ubuntu-latest
name: Merge Docker Manifests
strategy:
matrix:
version:
- { tag: "13.3-legacy", dc_chain: "legacy" }
- { tag: "14.2-stable", dc_chain: "stable" }
- { tag: "15.0-dev", dc_chain: "dev" }
needs:
- build-arm64
- build-amd64
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Convert Repository Owner to Lowercase
id: lower-owner
run: |
echo "repository_owner=${GITHUB_REPOSITORY%%/*}" | tr '[:upper:]' '[:lower:]' >> $GITHUB_OUTPUT
- name: Create and Push Docker Manifest
run: |
docker buildx imagetools create \
--tag ghcr.io/${{ steps.lower-owner.outputs.repository_owner }}/dc-toolchain:${{ matrix.version.tag }} \
--tag ${{ secrets.DOCKER_HUB_USERNAME }}/dc-toolchain:${{ matrix.version.tag }} \
ghcr.io/${{ steps.lower-owner.outputs.repository_owner }}/dc-toolchain:${{ matrix.version.tag }}-arm64 \
ghcr.io/${{ steps.lower-owner.outputs.repository_owner }}/dc-toolchain:${{ matrix.version.tag }}-amd64 \
${{ secrets.DOCKER_HUB_USERNAME }}/dc-toolchain:${{ matrix.version.tag }}-arm64 \
${{ secrets.DOCKER_HUB_USERNAME }}/dc-toolchain:${{ matrix.version.tag }}-amd64