Skip to content

Commit

Permalink
add github ci
Browse files Browse the repository at this point in the history
  • Loading branch information
flerka committed Jan 2, 2022
1 parent 771f7a9 commit 92e9979
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: PR

on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
name: Build
steps:
- uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- run: dotnet build metrics-humidity.sln
- run: dotnet test metrics-humidity.sln
43 changes: 43 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: tag

on:
push:
tags:
- v*

jobs:
build:
runs-on: ubuntu-latest
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: arm64

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: latest

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Get the tag name
run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v2
with:
platforms: linux/arm64
push: true
tags: flerkam/metrics-humidity:${{ env.TAG }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This app push Deconz sensors data to Prometheus and visualize them with Grafana.
- if needed edit \prometheus\prometheus.yml to change schedule
- run in console docker-compose up --build
- go to http://localhost:3000/ and add prometheus data sourse (prometheus:9090 in my case)
- add labes to Grafana
- add labels to Grafana

## How it will look like
![main](https://raw.githubusercontent.com/flerka/metrics-humidity/main/.github/img/1.png)

0 comments on commit 92e9979

Please sign in to comment.