Skip to content

ci: add build-with-docker #1

ci: add build-with-docker

ci: add build-with-docker #1

Workflow file for this run

name: build-with-docker
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
jobs:
docker:
strategy:
fail-fast: false # Continue running jobs even if one fails
matrix:
os: [ubuntu-latest, macos-latest]
include:
- os: ubuntu-latest
platform: linux/amd64
target-arch: x86_64
- os: macos-latest
platform: linux/arm64
target-arch: aarch64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
build-args: |
TARGET_ARCH=${{ matrix.target-arch }}
push: false
platforms: ${{ matrix.platform }}
cache-from: type=gha,ref=piper-phonemize-${{ matrix.target-arch }}:buildcache
cache-to: type=gha,ref=piper-phonemize-${{ matrix.target-arch }}:buildcache,mode=max
outputs: type=local,dest=dist
# https://github.com/actions/upload-artifact?tab=readme-ov-file#usage
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.target-arch }}
path: dist/
retention-days: 90 # max retention period