Skip to content

Commit

Permalink
ci: Simplify Docker image build workflow
Browse files Browse the repository at this point in the history
Github is deprecating ubuntu-20.04 image and since testing was depending on that specific version I have to remove imate test part for now
  • Loading branch information
tphakala committed Feb 16, 2025
1 parent d1f568e commit 2b1e7c8
Showing 1 changed file with 3 additions and 41 deletions.
44 changes: 3 additions & 41 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,48 +20,10 @@ jobs:
golangci:
uses: ./.github/workflows/golangci-lint.yml

test-docker-image:
needs: [golangci]
# 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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build amd64 image for testing
uses: docker/build-push-action@v6
with:
context: .
tags: birdnet-go:test
load: true
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max

- 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
build-and-push-docker-image:
needs: golangci
if: github.event_name == 'push' && github.ref_name == 'main'
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout GitHub Action
uses: actions/checkout@v4
Expand Down

0 comments on commit 2b1e7c8

Please sign in to comment.