Skip to content

Build nitro-eigenda Docker Image #30

Build nitro-eigenda Docker Image

Build nitro-eigenda Docker Image #30

name: Build nitro-eigenda Docker Image
on:
workflow_dispatch:
jobs:
build-linux-amd64:
runs-on: linux-2xl
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache-linux
key: linux-buildx-${{ hashFiles('Dockerfile') }}
restore-keys: linux-buildx-
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/nitro-eigenda
tags: |
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=ref,event=tag,suffix={{sha}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,prefix=,format=short,enable=true
type=raw,value=latest,enable={{is_default_branch}}
type=match,pattern=^(v\d+\.\d+\.\d+-\w*)\..*$,value=$1,enable={{is_default_branch}}
- name: "Build and push for linux"
uses: docker/build-push-action@v5
with:
platform: linux/amd64
target: nitro-node-dev
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache-linux
cache-to: type=local,dest=/tmp/.buildx-cache-linux-new,mode=max
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache-linux
mv /tmp/.buildx-cache-linux-new /tmp/.buildx-cache-linux
build-linux-arm64:
runs-on: linux-2xl
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache-amd
key: amd-buildx-${{ hashFiles('Dockerfile') }}
restore-keys: amd-buildx-
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/nitro-eigenda
tags: |
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=ref,event=tag,suffix={{sha}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,prefix=,format=short,enable=true
type=raw,value=latest,enable={{is_default_branch}}
type=match,pattern=^(v\d+\.\d+\.\d+-\w*)\..*$,value=$1,enable={{is_default_branch}}
- name: "Build and push for amd"
uses: docker/build-push-action@v5
with:
platform: linux/arm64/v8
target: nitro-node-dev
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache-amd
cache-to: type=local,dest=/tmp/.buildx-cache-amd-new,mode=max
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache-amd
mv /tmp/.buildx-cache-amd-new /tmp/.buildx-cache-amd