Signed-off-by: wawa0210 <[email protected]> (#417) #1
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: Release Arm Image | |
env: | |
REGISTRY: docker.io | |
IMAGE_REPO: projecthami/hami | |
IMAGE_ROOT_PATH: docker | |
BUILD_PLATFORM: linux/arm64 | |
REGISTER_USER: ${{ github.actor }} | |
REGISTER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
tags: | |
- v* | |
jobs: | |
docker-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Get the version | |
id: get_version | |
run: | | |
VERSION=${GITHUB_REF#refs/tags/} | |
if [[ ${GITHUB_REF} == "refs/heads/main" ]]; then | |
VERSION=latest | |
fi | |
echo ::set-output name=VERSION::${VERSION} | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Checkout submodule | |
uses: Mushus/[email protected] | |
with: | |
basePath: # optional, default is . | |
submodulePath: libvgpu | |
- name: Docker Login | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKERHUB_TOKEN }} | |
password: ${{ secrets.DOCKERHUB_PASSWD }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
driver-opts: image=moby/buildkit:master | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_REPO }} | |
- name: Build & Pushing hami image | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: ${{ env.IMAGE_ROOT_PATH }}/Dockerfile | |
labels: ${{ steps.meta.outputs.labels }} | |
platforms: ${{ env.BUILD_PLATFORM }} | |
build-args: | | |
VERSION=${{ steps.get_version.outputs.VERSION }} | |
GOLANG_IMAGE=golang:1.22.5-bullseye | |
NVIDIA_IMAGE=nvidia/cuda:12.2.0-devel-ubuntu20.04 | |
DEST_DIR=/usr/local | |
tags: ${{ steps.meta.outputs.tags }} | |
push: true | |
github-token: ${{ env.REGISTER_PASSWORD }} | |