mirror of
https://github.com/hikhvar/mqtt2prometheus.git
synced 2026-08-23 21:16:15 +00:00
Build docker image on every push
Release docker image to github
This commit is contained in:
committed by
Christoph Petrausch
parent
c5f6fda731
commit
f0d19e17ab
@@ -0,0 +1,17 @@
|
||||
name: Docker Image CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["master"]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build the Docker image
|
||||
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
|
||||
@@ -1,4 +1,7 @@
|
||||
on: [push, pull_request]
|
||||
on:
|
||||
push:
|
||||
branches: ["master"]
|
||||
pull_request:
|
||||
name: linting
|
||||
jobs:
|
||||
linting:
|
||||
@@ -7,4 +10,4 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Run golangci-lint
|
||||
uses: actions-contrib/golangci-lint@v1
|
||||
uses: actions-contrib/golangci-lint@v1
|
||||
|
||||
@@ -28,3 +28,10 @@ jobs:
|
||||
args: release --rm-dist
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Release docker file
|
||||
- name: Build the Docker image
|
||||
run: docker build -t docker.pkg.github.com/hikhvar/mqtt2prometheus/mqtt2prometheus:latest -t docker.pkg.github.com/hikhvar/mqtt2prometheus/mqtt2prometheus:${{ github.ref }} .
|
||||
- name: Login to Github
|
||||
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
|
||||
- name: Publish image
|
||||
run: docker push docker.pkg.github.com/hikhvar/mqtt2prometheus:latest docker.pkg.github.com/hikhvar/mqtt2prometheus:${{ github.ref }}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
on: [push, pull_request]
|
||||
on:
|
||||
push:
|
||||
branches: ["master"]
|
||||
pull_request:
|
||||
name: tests
|
||||
jobs:
|
||||
test:
|
||||
@@ -17,4 +20,4 @@ jobs:
|
||||
- name: Test
|
||||
run: go test ./...
|
||||
- name: Vet
|
||||
run: go vet ./...
|
||||
run: go vet ./...
|
||||
|
||||
Reference in New Issue
Block a user