mirror of
https://github.com/neodyland/sbv2-api.git
synced 2026-01-06 06:22:57 +00:00
Compare commits
2 Commits
v0.2.0-rc.
...
v0.2.0-rc.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95b84ca55b | ||
|
|
033dd99fb6 |
65
.github/workflows/CI.yml
vendored
65
.github/workflows/CI.yml
vendored
@@ -18,6 +18,9 @@ on:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
|
env:
|
||||||
|
GHCR_REPO: ghcr.io/tuna2134/sbv2-api
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
linux:
|
linux:
|
||||||
@@ -129,36 +132,52 @@ jobs:
|
|||||||
command: upload
|
command: upload
|
||||||
args: --non-interactive --skip-existing wheels-*/*
|
args: --non-interactive --skip-existing wheels-*/*
|
||||||
|
|
||||||
build-docker:
|
build:
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.machine.runner }}
|
||||||
if: "startsWith(github.ref, 'refs/tags/')"
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
machine:
|
||||||
|
- platform: linux/amd64
|
||||||
|
runner: ubuntu-latest
|
||||||
|
- platform: linux/arm64
|
||||||
|
runner: ubuntu-24.04-arm64
|
||||||
tag: [cpu, cuda]
|
tag: [cpu, cuda]
|
||||||
platform: [ubuntu-latest, ubuntu-24.04-arm]
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Prepare
|
||||||
- name: Set up QEMU
|
run: |
|
||||||
uses: docker/setup-qemu-action@v3
|
platform=${{ matrix.machine.platform }}
|
||||||
- name: Set up Docker Buildx
|
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
${{ env.GHCR_REPO }}
|
||||||
|
|
||||||
|
- name: Login to GHCR
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
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
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
platforms: ${{ matrix.platform }}
|
||||||
file: docker/${{ matrix.tag }}.Dockerfile
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
outputs: type=image,"name=ghcr.io/tuna2134/sbv2-api",push-by-digest=true,name-canonical=true,push=true
|
outputs: type=image,"name=${{ env.GHCR_REPO }}",push-by-digest=true,name-canonical=true,push=true
|
||||||
|
file: docker/${{ matrix.tag }}.Dockerfile
|
||||||
|
|
||||||
- name: Export digest
|
- name: Export digest
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ${{ runner.temp }}/digests
|
mkdir -p ${{ runner.temp }}/digests
|
||||||
@@ -176,7 +195,7 @@ jobs:
|
|||||||
merge:
|
merge:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- build-docker
|
- build
|
||||||
steps:
|
steps:
|
||||||
- name: Download digests
|
- name: Download digests
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@@ -200,7 +219,7 @@ jobs:
|
|||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
ghcr.io/tuna2134/sbv2-api
|
${{ env.GHCR_REPO }}
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=ref,event=pr
|
type=ref,event=pr
|
||||||
@@ -211,8 +230,8 @@ jobs:
|
|||||||
working-directory: ${{ runner.temp }}/digests
|
working-directory: ${{ runner.temp }}/digests
|
||||||
run: |
|
run: |
|
||||||
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
||||||
$(printf 'ghcr.io/tuna2134/sbv2-api@sha256:%s ' *)
|
$(printf '${{ env.GHCR_REPO }}@sha256:%s ' *)
|
||||||
|
|
||||||
- name: Inspect image
|
- name: Inspect image
|
||||||
run: |
|
run: |
|
||||||
docker buildx imagetools inspect ghcr.io/tuna2134/sbv2-api:${{ steps.meta.outputs.version }}
|
docker buildx imagetools inspect ${{ env.GHCR_REPO }}:${{ steps.meta.outputs.version }}
|
||||||
|
|||||||
Reference in New Issue
Block a user