Skip to content

Build and publish Docker image #36

Build and publish Docker image

Build and publish Docker image #36

Workflow file for this run

name: Build and publish Docker image
on:
release:
types: [published]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
push_to_registry:
name: Build and push Docker image to GitHub Packages
strategy:
max-parallel: 2
matrix:
PLAT: ["2014"]
include:
- ARCH: x86_64
OS: ubuntu-latest
- ARCH: aarch64
OS: ubuntu-24.04-arm
# The type of runner that the job will run on
runs-on: ${{ matrix.OS }}
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Docker 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: Create tag from repo
run: | # Uses shell parameter expansion to lowercase
echo "TAG=ghcr.io/${GITHUB_REPOSITORY,,}-${{ matrix.PLAT }}_${{ matrix.ARCH }}:latest" >> $GITHUB_ENV
- name: Build and push image to GitHub Packages
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
build-args: |
ml_version=${{ matrix.PLAT }}
ml_arch=${{ matrix.ARCH }}
pull: true
push: true
tags: ${{ env.TAG }}