Generate KOS-Toolchain Docker Images #3
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: Generate KOS-Toolchain Docker Images | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- 'include/**' | |
- 'kernel/**' | |
- 'addons/**' | |
- 'utils/**' | |
workflow_run: | |
workflows: | |
- Generate Toolchain Docker Images | |
types: | |
- completed | |
permissions: | |
packages: write | |
contents: read | |
jobs: | |
build-arm64: | |
runs-on: self-hosted | |
name: Build for ARM64 | |
strategy: | |
matrix: | |
tag: | |
- "13.3-legacy" | |
- "14.2-stable" | |
- "15.0-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: Build and Push ARM64 Docker Image | |
uses: docker/build-push-action@v6 | |
with: | |
context: .github/docker | |
file: .github/docker/kos-Dockerfile | |
push: true | |
tags: | | |
ghcr.io/kallistiosunchained/dc-kos-toolchain:${{ matrix.tag }}-arm64 | |
${{ secrets.DOCKER_HUB_USERNAME }}/dc-kos-toolchain:${{ matrix.tag }}-arm64 | |
platforms: linux/arm64 | |
build-args: | | |
tag=${{ matrix.tag }} | |
no-cache: true | |
build-amd64: | |
runs-on: ubuntu-latest | |
name: Build for AMD64 | |
strategy: | |
matrix: | |
tag: | |
- "13.3-legacy" | |
- "14.2-stable" | |
- "15.0-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: Build and Push AMD64 Docker Image | |
uses: docker/build-push-action@v6 | |
with: | |
context: .github/docker | |
file: .github/docker/kos-Dockerfile | |
push: true | |
tags: | | |
ghcr.io/kallistiosunchained/dc-kos-toolchain:${{ matrix.tag }}-amd64 | |
${{ secrets.DOCKER_HUB_USERNAME }}/dc-kos-toolchain:${{ matrix.tag }}-amd64 | |
platforms: linux/amd64 | |
build-args: | | |
tag=${{ matrix.tag }} | |
no-cache: true | |
merge-manifest: | |
runs-on: ubuntu-latest | |
name: Merge Docker Manifests | |
strategy: | |
matrix: | |
tag: | |
- "13.3-legacy" | |
- "14.2-stable" | |
- "15.0-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: Create and Push Docker Manifest | |
run: | | |
docker buildx imagetools create \ | |
--tag ghcr.io/kallistiosunchained/dc-kos-toolchain:${{ matrix.tag }} \ | |
--tag ${{ secrets.DOCKER_HUB_USERNAME }}/dc-kos-toolchain:${{ matrix.tag }} \ | |
ghcr.io/kallistiosunchained/dc-kos-toolchain:${{ matrix.tag }}-arm64 \ | |
ghcr.io/kallistiosunchained/dc-kos-toolchain:${{ matrix.tag }}-amd64 \ | |
${{ secrets.DOCKER_HUB_USERNAME }}/dc-kos-toolchain:${{ matrix.tag }}-arm64 \ | |
${{ secrets.DOCKER_HUB_USERNAME }}/dc-kos-toolchain:${{ matrix.tag }}-amd64 |