Add github CI

This commit is contained in:
Vitaliy Skrypnyk
2021-09-01 16:06:59 +03:00
committed by Vitaliy Skrypnyk
parent 56f8f65d83
commit a2762faad2

40
.github/workflows/docker-publish.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: Publish docker images
on:
push:
branches:
- 'master'
release:
types: [ published ]
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: techh/keenetic-grafana-monitoring
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}