Github action to publish testnet docker images (#974)

This commit is contained in:
gusto 2024-12-30 15:34:09 +07:00 committed by GitHub
parent 2f89d6c344
commit 40adc8db5b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 75 additions and 20 deletions

View File

@ -0,0 +1,70 @@
name: Publish Testnet Docker Image
on:
workflow_dispatch:
inputs:
branch:
description: "Branch to build the Docker image from"
required: true
default: "master"
tag:
description: "Docker image tag to use"
required: true
default: "latest"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
push_to_registries:
name: Push Docker image to multiple registries
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5
with:
driver: docker-container
install: true
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push multi-platform Docker images
id: push
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./testnet/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.tag }}
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

View File

@ -4,10 +4,7 @@ services:
cfgsync:
container_name: cfgsync
build:
context: .
dockerfile: testnet/Dockerfile
image: nomos:latest
image: ghcr.io/logos-co/nomos-node:testnet
volumes:
- ./testnet:/etc/nomos
depends_on:
@ -16,10 +13,7 @@ services:
nomos-node-0:
container_name: nomos_node_0
build:
context: .
dockerfile: testnet/Dockerfile
image: nomos:latest
image: ghcr.io/logos-co/nomos-node:testnet
ports:
- "3000:3000/udp"
- "18080:18080/tcp"
@ -32,10 +26,7 @@ services:
nomos-node-1:
container_name: nomos_node_1
build:
context: .
dockerfile: testnet/Dockerfile
image: nomos:latest
image: ghcr.io/logos-co/nomos-node:testnet
volumes:
- ./testnet:/etc/nomos
- ./tests/kzgrs/kzgrs_test_params:/kzgrs_test_params:z
@ -48,10 +39,7 @@ services:
nomos-node-2:
container_name: nomos_node_2
build:
context: .
dockerfile: testnet/Dockerfile
image: nomos:latest
image: ghcr.io/logos-co/nomos-node:testnet
volumes:
- ./testnet:/etc/nomos
- ./tests/kzgrs/kzgrs_test_params:/kzgrs_test_params:z
@ -64,10 +52,7 @@ services:
nomos-node-3:
container_name: nomos_node_3
build:
context: .
dockerfile: testnet/Dockerfile
image: nomos:latest
image: ghcr.io/logos-co/nomos-node:testnet
volumes:
- ./testnet:/etc/nomos
- ./tests/kzgrs/kzgrs_test_params:/kzgrs_test_params:z