File size: 1,580 Bytes
aa5390b
 
 
56b662d
aa5390b
56b662d
 
6e8a2c4
 
aa5390b
 
 
 
 
 
 
 
 
47627a9
af41874
47627a9
aa5390b
 
 
 
 
 
 
 
 
 
 
39ee116
aa5390b
 
47627a9
 
aa5390b
56b662d
 
aa5390b
 
 
 
 
 
 
56b662d
 
aa5390b
 
6e8a2c4
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: docker-build-and-push

on:
  workflow_dispatch:
  push:
    tags:
      - 'v*'
  release:
    types: [published]

jobs:
  docker:
    runs-on: ubuntu-22.04
    strategy:
      matrix:
        dockerfile: [Dockerfile.cuda, Dockerfile.cpu]
        include:
          - dockerfile: Dockerfile.cuda
            tag-suffix: -cuda
          - dockerfile: Dockerfile.cpu
            tag-suffix: -cpu
    steps:
      - uses: actions/checkout@v4
      - name: Login to Docker Hub
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      - id: meta
        uses: docker/metadata-action@v5
        with:
          images: |
            fedirz/faster-whisper-server
          # https://github.com/docker/metadata-action?tab=readme-ov-file#flavor-input
          flavor: |
            latest=false
            suffix=${{ matrix.tag-suffix}}
          tags: |
            type=semver,pattern={{version}}
            type=semver,pattern={{major}}.{{minor}}
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3
      - name: Build and push
        uses: docker/build-push-action@v5
        with:
          context: .
          file: ${{ matrix.dockerfile }}
          push: true
          # TODO:
          # platforms: linux/amd64,linux/arm64
          tags: ${{ steps.meta.outputs.tags }}
          cache-from: type=registry,ref=fedirz/faster-whisper-server:buildcache
          cache-to: type=registry,ref=fedirz/faster-whisper-server:buildcache,mode=max