Build and Publish container #65
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: Build and Publish container | |
on: | |
workflow_dispatch: | |
inputs: | |
publish: | |
description: 'Publish to ghcr?' | |
required: false | |
default: 'false' | |
specific-version: | |
description: 'Publish tag with specific version? (from .env)' | |
required: true | |
default: 'true' | |
latest-version: | |
description: 'Publish tag "latest"?' | |
required: true | |
default: 'false' | |
env: | |
IMAGE_ID_BASE: ghcr.io/axlabs/neo3-privatenet-docker/neo-cli | |
IMAGE_ID_PLUGINS: ghcr.io/axlabs/neo3-privatenet-docker/neo-cli-with-plugins | |
VERSION_LATEST: latest | |
jobs: | |
ghcr_push: | |
runs-on: ubuntu-latest | |
if: github.event.inputs.publish == 'true' | |
steps: | |
- name: checkout with submodules | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Load .env | |
id: loadenv | |
uses: ./.github/actions/load-env | |
- name: Build and push base image (neo-node) ('latest' tag) | |
if: github.event.inputs.latest-version == 'true' | |
uses: docker/build-push-action@v5 | |
with: | |
no-cache: true | |
push: true | |
tags: "${{ env.IMAGE_ID_BASE }}:${{ env.VERSION_LATEST }}" | |
platforms: linux/amd64,linux/arm64 | |
context: ./neo-node | |
- name: Build and push base image (neo-node) (specific version tag) | |
if: github.event.inputs.specific-version == 'true' | |
uses: docker/build-push-action@v5 | |
with: | |
no-cache: true | |
push: true | |
tags: "${{ env.IMAGE_ID_BASE }}:${{ steps.loadenv.outputs.IMAGE_TAG }}" | |
platforms: linux/amd64,linux/arm64 | |
context: ./neo-node | |
- name: Build and push neo-cli-with-plugins ('latest' tag) | |
if: github.event.inputs.latest-version == 'true' | |
uses: docker/build-push-action@v5 | |
with: | |
no-cache: true | |
push: true | |
tags: "${{ env.IMAGE_ID_PLUGINS }}:${{ env.VERSION_LATEST }}" | |
platforms: linux/amd64,linux/arm64 | |
file: ./docker/Dockerfile | |
target: NeoCliFinal | |
build-args: IMAGE_TAG=${{ env.VERSION_LATEST }} | |
context: ./neo-modules | |
- name: Build and push neo-cli-with-plugins (specific version tag) | |
if: github.event.inputs.specific-version == 'true' | |
uses: docker/build-push-action@v5 | |
with: | |
no-cache: true | |
push: true | |
tags: "${{ env.IMAGE_ID_PLUGINS }}:${{ steps.loadenv.outputs.IMAGE_TAG }}" | |
platforms: linux/amd64,linux/arm64 | |
file: ./docker/Dockerfile | |
target: NeoCliFinal | |
build-args: IMAGE_TAG=${{ steps.loadenv.outputs.IMAGE_TAG }} | |
context: ./neo-modules |