Skip to content

ci(docker): 🐳 comment out unused Buildx flags #4

ci(docker): 🐳 comment out unused Buildx flags

ci(docker): 🐳 comment out unused Buildx flags #4

name: Build and Push Docker Images
on:
push:
tags:
- "v*"
env:
REGISTRY: ghcr.io
IMAGE_NAME: aymurai/whisperlivekit
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- dockerfile: Dockerfile
suffix: ""
- dockerfile: Dockerfile.cpu
suffix: "-cpu"
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Frees tens of GB on GH-hosted runners (safe even if some dirs don't exist)
- name: Free disk space
run: |
set -euxo pipefail
echo "Before:"
df -h
sudo rm -rf /usr/local/lib/android || true
sudo rm -rf /usr/share/dotnet || true
sudo rm -rf /opt/ghc || true
sudo rm -rf /opt/hostedtoolcache/CodeQL || true
docker system prune -af || true
echo "After:"
df -h
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# with:
# buildkitd-flags: |
# --oci-worker-gc=true
# --oci-worker-gc-keepstorage=20GB
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch,suffix=${{ matrix.suffix }}
type=ref,event=pr,suffix=${{ matrix.suffix }}
type=semver,pattern={{version}},suffix=${{ matrix.suffix }}
type=semver,pattern={{major}}.{{minor}},suffix=${{ matrix.suffix }}
type=semver,pattern={{major}},suffix=${{ matrix.suffix }}
type=sha,suffix=${{ matrix.suffix }}
flavor: |
latest=${{ matrix.suffix == '' }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max