-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to create the build layer images
- Loading branch information
Showing
3 changed files
with
119 additions
and
11 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 |
---|---|---|
@@ -0,0 +1,108 @@ | ||
name: Docker layers | ||
|
||
# | ||
# The workflow is meant to be triggered manually when there is a need to update the build layers. | ||
# | ||
|
||
on: | ||
# TODO: To be removed after PR is merged. | ||
pull_request: | ||
|
||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "The version tag to use" | ||
required: true | ||
default: latest | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
TMP_LOCAL_IMAGE: localhost:5000/radixdlt/babylon-node-build-layers | ||
REGISTRY_IMAGE: docker.io/radixdlt/babylon-node-build-layers | ||
REGISTRY_TAG: latest | ||
|
||
jobs: | ||
build_java_layer: | ||
strategy: | ||
matrix: | ||
os: ["ubuntu-latest-8-cores", "ubuntu-latest-arm-8-cores"] | ||
arch: ["amd64", "arm64"] | ||
exclude: | ||
- os: ubuntu-latest-8-cores | ||
arch: arm64 | ||
- os: ubuntu-latest-arm-8-cores | ||
arch: amd64 | ||
name: Build Java docker layer | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: RDXWorks-actions/checkout@main | ||
- name: Set up Docker Buildx | ||
uses: RDXWorks-actions/setup-buildx-action@master | ||
- name: Prepare docker build | ||
run: | | ||
mkdir -p /tmp/images | ||
platform=${{ matrix.arch }} | ||
echo "TARFILE=${platform}-java.tar" >> $GITHUB_ENV | ||
echo "TAG=${{ env.TMP_LOCAL_IMAGE }}:${platform}-java" >> $GITHUB_ENV | ||
- name: Build image | ||
uses: RDXWorks-actions/build-push-action@v6 | ||
with: | ||
file: ./docker/dockerfiles/java.dockerfile | ||
context: . | ||
platforms: linux/${{ matrix.arch }} | ||
tags: ${{ env.TAG }}-java | ||
labels: ${{ steps.meta.outputs.labels }} | ||
outputs: type=docker,dest=/tmp/images/${{ env.TARFILE }} | ||
push: false | ||
- name: Upload images | ||
uses: RDXWorks-actions/upload-artifact-v4@main | ||
with: | ||
name: images-${{ matrix.arch }}-java | ||
path: /tmp/images/${{ env.TARFILE }} | ||
if-no-files-found: error | ||
retention-days: 1 | ||
|
||
build_rust_layer: | ||
strategy: | ||
matrix: | ||
os: ["ubuntu-latest-8-cores", "ubuntu-latest-arm-8-cores"] | ||
arch: ["amd64", "arm64"] | ||
exclude: | ||
- os: ubuntu-latest-8-cores | ||
arch: arm64 | ||
- os: ubuntu-latest-arm-8-cores | ||
arch: amd64 | ||
name: Build Rust docker layer | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: RDXWorks-actions/checkout@main | ||
- name: Set up Docker Buildx | ||
uses: RDXWorks-actions/setup-buildx-action@master | ||
- name: Prepare docker build | ||
run: | | ||
mkdir -p /tmp/images | ||
platform=${{ matrix.arch }} | ||
echo "TARFILE=${platform}-rust.tar" >> $GITHUB_ENV | ||
echo "TAG=${{ env.TMP_LOCAL_IMAGE }}:${platform}-rust" >> $GITHUB_ENV | ||
- name: Build image | ||
uses: RDXWorks-actions/build-push-action@v6 | ||
with: | ||
file: ./docker/dockerfiles/rust.dockerfile | ||
context: . | ||
platforms: linux/${{ matrix.arch }} | ||
tags: ${{ env.TAG }}-rust | ||
labels: ${{ steps.meta.outputs.labels }} | ||
outputs: type=docker,dest=/tmp/images/${{ env.TARFILE }} | ||
push: false | ||
- name: Upload images | ||
uses: RDXWorks-actions/upload-artifact-v4@main | ||
with: | ||
name: images-${{ matrix.arch }}-rust | ||
path: /tmp/images/${{ env.TARFILE }} | ||
if-no-files-found: error | ||
retention-days: 1 |
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
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