mirror of
https://github.com/superlinear-ai/python-gpu.git
synced 2025-03-26 03:37:17 +03:00
45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
name: Build and deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- master
|
|
|
|
jobs:
|
|
build_and_push_to_dockerhub:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
version:
|
|
- python: "3.8"
|
|
tag: "cuda11.8-python3.8"
|
|
- python: "3.9"
|
|
tag: "cuda11.8-python3.9"
|
|
- python: "3.10"
|
|
tag: "cuda11.8-python3.10"
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: my.registry.com
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Setup Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
push: true
|
|
build-args: PYTHON_VERSION=${{ matrix.version.python }}
|
|
tags: my_registry.com/${{ matrix.version.tag }}:$
|
|
cache-from: type=registry,ref=my_registry.com/${{ matrix.version.tag }}:latest |