Build manylinux2014 + cuda image #24
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 manylinux2014 + cuda image | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'manylinux2014_cuda_aarch64/*' | |
- 'manylinux2014_cuda_x86_64/*' | |
- '.github/workflows/build-manylinux2014-cuda.yml' | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: '30 12 * * 5' | |
concurrency: | |
# SHA is added to the end if on `main` to let all main workflows run | |
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == 'refs/heads/main' && github.sha || '' }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: [aarch64, x86_64] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- name: Docker meta aarch64 | |
if: matrix.arch == 'aarch64' | |
id: meta_aarch64 | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
ghcr.io/${{ github.repository }}/manylinux2014_cuda_aarch64 | |
# generate Docker tags based on the following events/attributes | |
# latest is only tagged if we're on the default branch | |
tags: | | |
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }} | |
type=sha,format=long | |
- name: Build Docker Container | |
if: matrix.arch == 'aarch64' | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./manylinux2014_cuda_aarch64 | |
file: ./manylinux2014_cuda_aarch64/Dockerfile | |
push: true | |
platforms: linux/arm64 | |
tags: ${{ steps.meta_aarch64.outputs.tags }} | |
- name: Docker meta aarch64 | |
if: matrix.arch == 'x86_64' | |
id: meta_x86_64 | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
ghcr.io/${{ github.repository }}/manylinux2014_cuda_x86_64 | |
# generate Docker tags based on the following events/attributes | |
# latest is only tagged if we're on the default branch | |
tags: | | |
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }} | |
type=sha,format=long | |
- name: Build Docker Container | |
if: matrix.arch == 'x86_64' | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./manylinux2014_cuda_x86_64 | |
file: ./manylinux2014_cuda_x86_64/Dockerfile | |
push: true | |
platforms: linux/amd64 | |
tags: ${{ steps.meta_x86_64.outputs.tags }} |