Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions .github/workflows/cd-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Publish nilchain-devnet to GHCR

on:
push:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
packages: write # Required to push to GHCR

jobs:
build-and-push-arch:
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
platform: linux/amd64
runner: ubuntu-latest
- arch: arm64
platform: linux/arm64
runner: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Extract metadata for version
id: meta_tag
uses: docker/metadata-action@v5
with:
images: ghcr.io/nillionnetwork/nilchain-devnet
tags: |
type=ref,event=branch
type=ref,event=tag
type=sha,prefix=
flavor: |
latest=false

- name: Build and push arch-specific image
uses: docker/build-push-action@v6
with:
context: .
platforms: ${{ matrix.platform }}
push: true
tags: ghcr.io/nillionnetwork/nilchain-devnet:${{ github.sha }}-${{ matrix.arch }}
build-args: |
VERSION=${{ steps.meta_tag.outputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false

create-and-push-manifest:
runs-on: ubuntu-latest
needs: build-and-push-arch
steps:
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract final tags
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/nillionnetwork/nilchain-devnet
tags: |
type=ref,event=branch
type=ref,event=tag
flavor: |
latest=false

- name: Create and push multi-arch manifest
run: |
echo "${{ steps.meta.outputs.tags }}" > tags.txt

while IFS= read -r tag; do
if [ -n "$tag" ]; then
echo "Creating and pushing manifest for tag: $tag"

docker manifest create "$tag" \
ghcr.io/nillionnetwork/nilchain-devnet:${{ github.sha }}-amd64 \
ghcr.io/nillionnetwork/nilchain-devnet:${{ github.sha }}-arm64

docker manifest push "$tag"
fi
done < tags.txt
67 changes: 0 additions & 67 deletions .github/workflows/docker.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/nillionnetwork/nilchaind:v0.2.5
FROM ghcr.io/nillionnetwork/nilchaind:main

WORKDIR /opt/nilchain

Expand Down
Loading