Skip to content

Commit

Permalink
Merge pull request #39 from isZumpo/docker-build-action
Browse files Browse the repository at this point in the history
Add basic github action for building docker image
  • Loading branch information
tphakala authored Mar 3, 2024
2 parents 19cfade + 937e098 commit ea817bc
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Dockerfile
.dockerignore
.gitignore
.git
.github
30 changes: 30 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy Image to GHCR

on:
push:
branches:
- main
workflow_dispatch:

jobs:
push-docker-image:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4.1.1

- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v3.0.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: 'Build Inventory Image'
run: |
docker build . --tag ghcr.io/${REPO}:latest
docker push ghcr.io/${REPO}:latest
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
FROM golang:1.22.0-bookworm as build

ARG TESNSORFLOW_VERSION=v2.14.0
ARG TENSORFLOW_VERSION=v2.14.0
ARG PLATFORM=linux_amd64

# Download and configure precompiled TensorFlow Lite C library
RUN curl -L \
https://github.com/tphakala/tflite_c/releases/download/${TESNSORFLOW_VERSION}/tflite_c_${TESNSORFLOW_VERSION}_${PLATFORM}.tar.gz | \
https://github.com/tphakala/tflite_c/releases/download/${TENSORFLOW_VERSION}/tflite_c_${TENSORFLOW_VERSION}_${PLATFORM}.tar.gz | \
tar -C "/usr/local/lib" -xz \
&& ldconfig

WORKDIR /root/src

# Download TensorFlow headers
RUN git clone --branch ${TESNSORFLOW_VERSION} --depth 1 https://github.com/tensorflow/tensorflow.git
RUN git clone --branch ${TENSORFLOW_VERSION} --depth 1 https://github.com/tensorflow/tensorflow.git

# Compile BirdNET-GO
COPY . BirdNET-Go
Expand Down

0 comments on commit ea817bc

Please sign in to comment.