chore(CI): Also remove docker images to free disk space #10
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_publish | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: | |
- "master" | |
tags: | |
- "*" | |
pull_request: | |
branches: | |
- "master" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
docker-no_model: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
max-parallel: 1 # only one job at a time | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
with: | |
# this might remove tools that are actually needed, | |
# if set to "true" but frees about 6 GB | |
tool-cache: true | |
# all of these default to true, but feel free to set to | |
# "false" if necessary for your workflow | |
android: true | |
dotnet: true | |
haskell: true | |
large-packages: true | |
docker-images: true | |
swap-storage: false | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Docker meta data:no_model | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ secrets.DOCKERHUB_USERNAME }}/whisperx,ghcr.io/${{ github.repository_owner }}/whisperx | |
flavor: | | |
latest=true | |
prefix= | |
suffix= | |
tags: | | |
no_model | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
# Create a Access Token and save it as as Actions secret | |
# https://hub.docker.com/settings/security | |
# DOCKERHUB_USERNAME | |
# DOCKERHUB_TOKEN | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# Create a Access Token with `read:packages` and `write:packages` scopes | |
# CR_PAT | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
- name: Build and push:no_model | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./Dockerfile.no_model | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
platforms: linux/amd64,linux/arm64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
docker: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
max-parallel: 1 # only one job at a time | |
matrix: | |
lang: | |
- en | |
- fr | |
- de | |
- es | |
- it | |
- ja | |
- zh | |
- nl | |
- uk | |
- pt | |
- ar | |
- cs | |
- ru | |
- pl | |
- hu | |
- fi | |
- fa | |
- el | |
- tr | |
- da | |
- he | |
- vi | |
- ko | |
- ur | |
- te | |
model: | |
- tiny | |
- base | |
- small | |
- medium | |
- large-v2 | |
needs: docker-no_model # wait for docker-no_model to finish | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
with: | |
# this might remove tools that are actually needed, | |
# if set to "true" but frees about 6 GB | |
tool-cache: true | |
# all of these default to true, but feel free to set to | |
# "false" if necessary for your workflow | |
android: true | |
dotnet: true | |
haskell: true | |
large-packages: true | |
docker-images: true | |
swap-storage: false | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Docker meta data:${{ matrix.model }}-${{ matrix.lang }} | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ secrets.DOCKERHUB_USERNAME }}/whisperx,ghcr.io/${{ github.repository_owner }}/whisperx | |
flavor: | | |
latest=false | |
prefix= | |
suffix= | |
tags: | | |
${{ matrix.model}}-${{ matrix.lang }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
# Create a Access Token and save it as as Actions secret | |
# https://hub.docker.com/settings/security | |
# DOCKERHUB_USERNAME | |
# DOCKERHUB_TOKEN | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# Create a Access Token with `read:packages` and `write:packages` scopes | |
# CR_PAT | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
- name: Build and push:${{ matrix.model }}-${{ matrix.lang }} | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: | | |
WHISPER_MODEL=${{ matrix.model }} | |
LANG=${{ matrix.lang }} | |
platforms: linux/amd64,linux/arm64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |