Skip to content

Commit

Permalink
Merge pull request #6 from hikhvar/docker-builds
Browse files Browse the repository at this point in the history
Create dockerimage.yml
  • Loading branch information
hikhvar authored Apr 21, 2020
2 parents c5f6fda + f0d19e1 commit bdb825f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
@@ -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)
7 changes: 5 additions & 2 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
on: [push, pull_request]
on:
push:
branches: ["master"]
pull_request:
name: linting
jobs:
linting:
Expand All @@ -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
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
7 changes: 5 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
on: [push, pull_request]
on:
push:
branches: ["master"]
pull_request:
name: tests
jobs:
test:
Expand All @@ -17,4 +20,4 @@ jobs:
- name: Test
run: go test ./...
- name: Vet
run: go vet ./...
run: go vet ./...

0 comments on commit bdb825f

Please sign in to comment.