Skip to content

Nearcore Docker Image #4

Nearcore Docker Image

Nearcore Docker Image #4

name: Nearcore Docker Image
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag'
required: true
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/nearcore
VERSION: ${{ github.event.inputs.tag || github.event.release.tag_name || '' }}
jobs:
build-and-push:
runs-on: k8s-infrastructure-dind
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha
type=raw,value=latest,enable=true
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
file: contrib/config/build/Dockerfile.neard
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
VERSION=${{ env.VERSION }}