Use a rust layer with a full app build #1
Workflow file for this run
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 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 |