docs: add quotes #5
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: Docker CI | |
on: | |
push: | |
branches: [main] | |
tags: ["*.*.*"] | |
paths-ignore: | |
- "mkdocs.yml" | |
- "docs/**" | |
- "**.md" | |
- "**.mdx" | |
- "**.png" | |
- "**.jpg" | |
- "**.gif" | |
pull_request: | |
branches: [main] | |
paths: | |
- "Dockerfile" | |
- "Dockerfile.*" | |
- ".github/workflows/docker-ci.yaml" | |
jobs: | |
publish-docker: | |
permissions: | |
contents: write | |
actions: read | |
id-token: write | |
timeout-minutes: 60 | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
device: ["cuda", "musa", "npu", "cpu"] | |
env: | |
PACKAGE_REGISTRY: ${{ vars.PACKAGE_REGISTRY || 'gpustack'}} | |
PACKAGE_IMAGE: ${{ vars.PACKAGE_IMAGE || 'gpustack' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
persist-credentials: false | |
- name: Free Space | |
uses: jlumbroso/free-disk-space@v1.3.1 | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
image: tonistiigi/binfmt:qemu-v7.0.0 | |
platforms: "arm64" | |
- name: Setup Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login DockerHub | |
uses: docker/login-action@v3 | |
if: github.event_name != 'pull_request' | |
with: | |
username: ${{ secrets.CI_DOCKERHUB_USERNAME }} | |
password: ${{ secrets.CI_DOCKERHUB_PASSWORD }} | |
- name: Get Metadata | |
id: metadata | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.PACKAGE_REGISTRY }}/${{ env.PACKAGE_IMAGE }} | |
tags: | | |
type=pep440,pattern={{version}} | |
type=pep440,pattern={{major}}.{{minor}} | |
type=ref,event=branch | |
type=ref,event=pr | |
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'rc') }} | |
# set no tag suffix for cuda as the default, set -{device} suffix for others | |
flavor: | | |
suffix=${{ matrix.device != 'cuda' && format('-{0}', matrix.device) || '' }} | |
- name: Package | |
uses: docker/build-push-action@v5 | |
id: package | |
with: | |
push: ${{ github.event_name != 'pull_request' }} | |
file: ${{ github.workspace }}/${{ matrix.device == 'cuda' && 'Dockerfile' || format('Dockerfile.{0}', matrix.device) }} | |
context: ${{ github.workspace }} | |
platforms: "linux/amd64,linux/arm64" | |
tags: ${{ steps.metadata.outputs.tags }} | |
labels: ${{ steps.metadata.outputs.labels }} | |
provenance: true | |
sbom: true |