Skip to content
name: Build and Publish Docker Images
on:
workflow_dispatch:
push:
branches:
- main
- build-and-publish-images
paths:
- docker/**
- .github/workflows/build_and_publish_docker_images.yaml
pull_request:
paths:
- docker/**
- .github/workflows/build_and_publish_docker_images.yaml
types: [opened, reopened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build_and_publish_cpu_docker_image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
uses: docker/metadata-action@v3
id: meta
with:
images: ghrc.io/huggingface/optimum-benchmark:latest-cpu
- name: Build and push Docker images
uses: docker/build-push-action@v3
id: push
with:
context: .
file: docker/cpu/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
push: true