blakeblackshear.frigate/.github/workflows/ci.yml
Blake Blackshear 370276a7b6
Faster image builds with caching (#4491)
* fix makefile variable

* add branch for testing

* fix arm32 build

* use amd64 for web build

* install wheels in a separate layer for better parallel builds

* try build-push-action

* try using gh context

* use short sha

* cleanup
2022-11-23 20:00:45 -06:00

41 lines
1.1 KiB
YAML

name: CI
on:
push:
branches:
- dev
- master
env:
PYTHON_VERSION: 3.9
jobs:
multi_arch_build:
runs-on: ubuntu-latest
name: Image Build
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create short sha
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: |
ghcr.io/blakeblackshear/frigate:${{ github.ref_name }}-${{ env.SHORT_SHA }}
cache-from: type=gha
cache-to: type=gha,mode=max