Skip to content

Commit

Permalink
github actions - added docker build and push
Browse files Browse the repository at this point in the history
  • Loading branch information
csautter committed Feb 11, 2024
1 parent 013750b commit 81f0de2
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 25 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ name: auto-merge
on:
pull_request:

permissions:
pull-requests: write
issues: write
repository-projects: write

jobs:
auto-merge:
runs-on: ubuntu-latest
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# https://github.com/marketplace/actions/build-and-push-docker-images
name: docker-build

on:
pull_request:

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push latest
uses: docker/build-push-action@v5
if: github.ref == 'refs/heads/master'
with:
push: true
tags: ccs1/volkszahler-fritzapi:latest
-
name: Build and push PR
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:component/vzlogger/"
push: true
tags: ccs1/volkszahler-fritzapi:pr_${{github.event.number}}_${{github.sha}}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ FB_URL=http://192.168.178.1/
# Fritz Box User Account
FB_USER=user
# Fritz Box Passwort
FB_PASS=Snu6t2pZ3JXELXN7
FB_PASS=<YOUR_PASSWORD>
````
### Get switch energy consumption in Wh and power in W

Expand Down
40 changes: 21 additions & 19 deletions component/vzlogger/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@ FROM debian:buster-20240130-slim

EXPOSE 80

RUN apt-get -y update
RUN apt-get install -y git
RUN apt-get install -y cmake
RUN apt-get install -y autoconf
RUN apt-get install -y libtool
RUN apt-get install -y uuid-dev
RUN apt-get install -y libcurl4-openssl-dev
RUN apt-get install -y libssl-dev
RUN apt-get install -y libgnutls28-dev
RUN apt-get install -y libgcrypt20-dev
RUN apt-get install -y libmicrohttpd-dev
RUN apt-get install -y libsasl2-dev
RUN apt-get install -y libunistring-dev
RUN apt-get install -y wget
RUN apt-get install -y sudo
RUN apt-get install -y pkg-config
RUN apt-get install -y build-essential
RUN apt-get install -y vim
RUN apt-get install -y nodejs
RUN apt-get -y update \
&& apt-get install -y git \
cmake \
autoconf \
libtool \
uuid-dev \
libcurl4-openssl-dev \
libssl-dev \
libgnutls28-dev \
libgcrypt20-dev \
libmicrohttpd-dev \
libsasl2-dev \
libunistring-dev \
wget \
sudo \
pkg-config \
build-essential \
vim \
nodejs \
&& apt-get clean \
&& rm -rf /var/cache/apt/archives /var/lib/apt/lists

WORKDIR /app
COPY install.sh .
Expand Down

0 comments on commit 81f0de2

Please sign in to comment.