Xenobd/whisper.cpp
0
1name: Publish Docker image2 3on:4 pull_request:5 push:6 branches:7 - master8 9jobs:10 push_to_registry:11 name: Push Docker image to Docker Hub12 if: github.event.pull_request.draft == false13 14 runs-on: ubuntu-22.0415 env:16 COMMIT_SHA: ${{ github.sha }}17 strategy:18 fail-fast: false19 matrix:20 config:21 - { tag: "main", dockerfile: ".devops/main.Dockerfile", platform: "linux/amd64" }22 - { tag: "main-musa", dockerfile: ".devops/main-musa.Dockerfile", platform: "linux/amd64" }23 - { tag: "main-intel", dockerfile: ".devops/main-intel.Dockerfile", platform: "linux/amd64" }24 - { tag: "main-cuda", dockerfile: ".devops/main-cuda.Dockerfile", platform: "linux/amd64" }25 26 steps:27 - name: Check out the repo28 uses: actions/checkout@v329 30 - name: Set up QEMU31 uses: docker/setup-qemu-action@v332 with:33 image: tonistiigi/binfmt:qemu-v7.0.0-2834 35 - name: Set up Docker Buildx36 uses: docker/setup-buildx-action@v337 38 - name: Log in to Docker Hub39 uses: docker/login-action@v340 with:41 registry: ghcr.io42 username: ${{ github.repository_owner }}43 password: ${{ secrets.GITHUB_TOKEN }}44 45 - name: Free up disk space46 run: |47 sudo apt-get remove -y '^dotnet-.*' '^llvm-.*' '^mysql-.*' '^postgresql-.*'48 sudo apt-get autoremove -y49 sudo apt-get autoclean50 51 sudo rm -rf /usr/share/dotnet52 sudo rm -rf /usr/local/lib/android53 sudo rm -rf /opt/ghc54 sudo rm -rf /opt/hostedtoolcache/CodeQL55 56 docker system prune -af57 58 df -h59 60 - name: Generate tags61 id: tags62 run: |63 TAGS="ghcr.io/${{ github.repository }}:${{ matrix.config.tag }}"64 if [ "${{ github.event_name }}" == "push" ]; then65 TAGS="$TAGS,ghcr.io/${{ github.repository }}:${{ matrix.config.tag }}-${{ env.COMMIT_SHA }}"66 fi67 echo "tags=$TAGS" >> $GITHUB_OUTPUT68 69 - name: Build and push Docker image (tagged)70 uses: docker/build-push-action@v571 with:72 context: .73 push: ${{ github.event_name == 'push' }}74 platforms: ${{ matrix.config.platform }}75 tags: ${{ steps.tags.outputs.tags }}76 file: ${{ matrix.config.dockerfile }}77 