Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
use makefile to generate image
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterGrace committed Dec 5, 2020
1 parent a4ddfd6 commit 9aa7f88
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build . --file Dockerfile --tag petergrace/opentsdb-docker:latest
- uses: actions/checkout@v2
- name: Login to dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.HUB_DOCKER_USERNAME }}
password: ${{ secrets.HUB_DOCKER_PAT }}
- name: run makefile
run: make gh-build
shell: bash
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
all: build

build:
docker build -t petergrace/opentsdb-docker .

gh-build: HASH=$(shell git rev-parse --short HEAD)
gh-build:
docker build -t petergrace/opentsdb-docker:$(HASH) .
docker tag petergrace/opentsdb-docker:$(HASH) petergrace/opentsdb-docker:latest
docker push petergrace/opentsdb-docker:$(HASH)
docker push petergrace/opentsdb-docker:latest

0 comments on commit 9aa7f88

Please sign in to comment.