Skip to content

Commit

Permalink
ci: update how images are tagged, enable multi-arch builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedir Zadniprovskyi committed Jun 3, 2024
1 parent 1c2e658 commit 31cbeb3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/docker-build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
release:
types: [published]

env:
IMAGE_NAME: fedirz/faster-whisper-server

jobs:
docker:
runs-on: ubuntu-22.04
Expand All @@ -21,23 +24,24 @@ jobs:
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
${{ env.IMAGE_NAME }}
# https://github.com/docker/metadata-action?tab=readme-ov-file#flavor-input
flavor: |
latest=false
suffix=${{ matrix.tag-suffix}}
suffix=${{ matrix.tag-suffix}},onlatest=true
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
Expand All @@ -46,8 +50,7 @@ jobs:
context: .
file: ${{ matrix.dockerfile }}
push: true
# TODO:
# platforms: linux/amd64,linux/arm64
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
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max
3 changes: 3 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ tasks:
- Dockerfile.*
- faster_whisper_server/*.py
sync: lsyncd lsyncd.conf
cii:
cmds:
- act --rm --action-offline-mode --secret-file .secrets {{.CLI_ARGS}}
# Python's urllib3 takes forever when ipv6 is enabled
# https://support.nordvpn.com/hc/en-us/articles/20164669224337-How-to-disable-IPv6-on-Linux
disable-ipv6: sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 && sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
Expand Down

0 comments on commit 31cbeb3

Please sign in to comment.