From 5116a6051f46c2fd017d536f3a35e04452b3d6bf Mon Sep 17 00:00:00 2001 From: Sambo Chea Date: Mon, 29 Mar 2021 14:22:00 +0700 Subject: [PATCH] Add github action for public to docker hub and updated --- .../{gradle.yml => docker-private.yml} | 2 +- .github/workflows/docker-public.yml | 28 +++++++++++++++++++ Dockerfile | 2 +- Makefile | 10 +++++++ 4 files changed, 40 insertions(+), 2 deletions(-) rename .github/workflows/{gradle.yml => docker-private.yml} (95%) create mode 100644 .github/workflows/docker-public.yml create mode 100644 Makefile diff --git a/.github/workflows/gradle.yml b/.github/workflows/docker-private.yml similarity index 95% rename from .github/workflows/gradle.yml rename to .github/workflows/docker-private.yml index 718d6b1..f4253d2 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/docker-private.yml @@ -1,4 +1,4 @@ -name: CI +name: Docker CI Private on: push: diff --git a/.github/workflows/docker-public.yml b/.github/workflows/docker-public.yml new file mode 100644 index 0000000..fe54301 --- /dev/null +++ b/.github/workflows/docker-public.yml @@ -0,0 +1,28 @@ +name: Docker CI Public + +on: + push: + branches: + - 'master' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_SECRET }} + - + name: Checkout + uses: actions/checkout@v2 + + - + name: Build and Push from Makefile + run: | + make build \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index aec330a..ed11915 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -from node:14.16.0 +FROM node:14.16.0 LABEL maintainer="sombochea@cubetiqs.com" ENV ACCEPT_HIGHCHARTS_LICENSE="YES" diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2520545 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +DOCKER_IMAGE=cubetiq/highcharts-export-server + +build: + @echo 'Starting docker build' + docker build . -t ${DOCKER_IMAGE} + + @echo 'Starting docker push' + docker push ${DOCKER_IMAGE} + +.PHONY:build \ No newline at end of file