Skip to content

Add thumbnail support #134

Add thumbnail support

Add thumbnail support #134

Workflow file for this run

name: Build docker image
on:
push:
pull_request:
workflow_dispatch:
jobs:
test-docker-image:
# Ubuntu-20.04 required until this is fixed: https://github.com/actions/runner-images/discussions/9074
runs-on: ubuntu-20.04
steps:
- name: Checkout GitHub Action
uses: actions/checkout@v4.1.5
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.3.0
- name: Build amd64 image for testing
uses: docker/build-push-action@v5.3.0
with:
context: .
tags: birdnet-go:test
load: true
platforms: linux/amd64
cache-from: type=gha,scope=linux/amd64
cache-to: type=gha,mode=max,scope=linux/amd64
- name: Install alsa dummy module for testing built image
run: |
sudo apt-get install linux-modules-extra-$(uname -r)
sudo modprobe snd-dummy
- name: Test built amd64 image
run: |
docker run --rm -p 8080:8080 --device /dev/snd --env ALSA_CARD=0 birdnet-go:test realtime --source "Dummy" & p1=$!
if ! wget --retry-connrefused --waitretry=1 --tries=5 -q -O /dev/null http://localhost:8080; then
echo "Failed to reach container after 5 sec"
kill "$p1"
exit 1
else
echo "Container responded to request"
kill "$p1"
fi
push-docker-image:
needs: test-docker-image
if: github.event_name == 'push' && github.ref_name == 'main'
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- platform: linux/arm64
- platform: linux/amd64
steps:
- name: Checkout GitHub Action
uses: actions/checkout@v4.1.5
- name: Login to GitHub Container Registry
uses: docker/login-action@v3.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate downcase repository name
run: |
echo "REPO=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.3.0
- name: Build and push docker image
uses: docker/build-push-action@v5.3.0
with:
context: .
push: true
tags: |
ghcr.io/${{ env.REPO }}:dev
ghcr.io/${{ env.REPO }}:${{ github.sha }}
platforms: ${{ matrix.platform }}
cache-from: type=gha,scope=${{ matrix.platform }}
cache-to: type=gha,mode=max,scope=${{ matrix.platform }}