Skip to content

docker image

docker image #26

Workflow file for this run

name: docker image
on:
workflow_dispatch:
inputs:
NIM_VERSION:
description: "nim version"
required: true
default: "2.0.0"
type: string
NIMBLE_VERSION:
description: "nimble version"
required: true
default: "0.14.2"
type: string
BASE:
type: choice
description: "whether the base image should be alpine or ubuntu"
options:
- alpine
- ubuntu
message:
required: true
required: true
default: "ubuntu"
permissions:
packages: write
contents: read
jobs:
release:
runs-on: ${{ matrix.builder }}
strategy:
matrix:
include:
- builder: ubuntu-latest
platform: amd64
- builder: buildjet-2vcpu-ubuntu-2204-arm
platform: arm64
steps:
- name: Checkout Code
uses: actions/checkout@v1
# not necessary as build is native on ARM
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up Chalk
uses: crashappsec/setup-chalk-version@main
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Docker versions
run: |
docker info
docker version
- name: Build and Push Docker Image
uses: docker/build-push-action@v4
with:
file: Dockerfile.${{ inputs.BASE }}
push: true
provenance: false # https://github.com/docker/buildx/issues/1608
platforms: linux/${{ matrix.platform }}
build-args: |
NIM_VERSION=${{ inputs.NIM_VERSION }}
NIMBLE_VERSION=${{ inputs.NIMBLE_VERSION }}
tags: |
ghcr.io/${{ github.repository_owner }}/nim:${{ inputs.BASE }}-latest-${{ matrix.platform }}
ghcr.io/${{ github.repository_owner }}/nim:${{ inputs.BASE }}-${{ inputs.NIM_VERSION }}-${{ matrix.platform }}
manifest:
runs-on: ubuntu-latest
needs: release
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Create and push manifest images for latest
uses: Noelware/[email protected]
with:
inputs: ghcr.io/${{ github.repository_owner }}/nim:${{ inputs.BASE }}-latest
images: ghcr.io/${{ github.repository_owner }}/nim:${{ inputs.BASE }}-latest-amd64,ghcr.io/${{ github.repository_owner }}/nim:${{ inputs.BASE }}-latest-arm64
push: true
- name: Create and push manifest images for specific version
uses: Noelware/[email protected]
with:
inputs: ghcr.io/${{ github.repository_owner }}/nim:${{ inputs.BASE }}-${{ inputs.NIM_VERSION }}
images: ghcr.io/${{ github.repository_owner }}/nim:${{ inputs.BASE }}-${{ inputs.NIM_VERSION }}-amd64,ghcr.io/${{ github.repository_owner }}/nim:${{ inputs.BASE }}-${{ inputs.NIM_VERSION }}-arm64
push: true