mirror of
https://github.com/neodyland/sbv2-api.git
synced 2025-12-25 00:29:57 +00:00
Compare commits
5 Commits
v0.2.0-rc.
...
v0.2.0-rc.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2430fc794 | ||
|
|
2bfca72f41 | ||
|
|
95b84ca55b | ||
|
|
033dd99fb6 | ||
|
|
15aef30867 |
87
.github/workflows/CI.yml
vendored
87
.github/workflows/CI.yml
vendored
@@ -18,6 +18,10 @@ on:
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
packages: write
|
||||
|
||||
env:
|
||||
GHCR_REPO: ghcr.io/tuna2134/sbv2-api
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
@@ -129,33 +133,80 @@ jobs:
|
||||
command: upload
|
||||
args: --non-interactive --skip-existing wheels-*/*
|
||||
|
||||
push-docker:
|
||||
runs-on: ${{ matrix.platform }}
|
||||
if: "startsWith(github.ref, 'refs/tags/')"
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
build:
|
||||
runs-on: ${{ matrix.machine.runner }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
machine:
|
||||
- platform: amd64
|
||||
runner: ubuntu-latest
|
||||
- platform: arm64
|
||||
runner: ubuntu-24.04-arm64
|
||||
tag: [cpu, cuda]
|
||||
platform: [ubuntu-latest, ubuntu-24.04-arm]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to GitHub Container Registry
|
||||
- name: Prepare
|
||||
run: |
|
||||
platform=${{ matrix.machine.platform }}
|
||||
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
${{ env.GHCR_REPO }}
|
||||
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build and push image
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push by digest
|
||||
id: build
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
file: docker/${{ matrix.tag }}.Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/${{ github.repository }}:${{ matrix.tag }}
|
||||
file: docker/${{ matrix.tag }}.Dockerfile
|
||||
${{ env.GHCR_REPO }}:latest-${{ matrix.tag }}-${{ matrix.machine.platform }}
|
||||
|
||||
merge:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build
|
||||
steps:
|
||||
- name: Download digests
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ${{ runner.temp }}/digests
|
||||
pattern: digests-*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Merge
|
||||
run: |
|
||||
docker buildx imagetools create -t ${{ env.GHCR_REPO }}:cuda \
|
||||
${{ env.GHCR_REPO }}:latest-cuda-amd64 \
|
||||
${{ env.GHCR_REPO }}:latest-cuda-arm64
|
||||
docker buildx imagetools create -t ${{ env.GHCR_REPO }}:cpu \
|
||||
${{ env.GHCR_REPO }}:latest-cpu-amd64 \
|
||||
${{ env.GHCR_REPO }}:latest-cpu-arm64
|
||||
|
||||
Reference in New Issue
Block a user