Skip to content

Commit

Permalink
add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
exelban committed Apr 23, 2020
1 parent e51e42d commit bee8d2f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 3 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deploy to docker hub

on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set image name
run: echo ::set-env name=NAME::$(echo $IMAGE_TAG | sed -E 's/-v*([0-9].*)+//')

- name: Login to docker hub
if: success()
uses: actions-hub/docker/login@master
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

- name: Build image
if: success()
run: |
docker build -t exelban/baseimage:${IMAGE_TAG} ./${NAME}
docker tag exelban/baseimage:${IMAGE_TAG} exelban/baseimage:${NAME}-latest
- name: Push to docker hub (latest)
if: success()
uses: actions-hub/docker/cli@master
with:
args: push exelban/baseimage:${NAME}-latest

- name: Push to docker hub (tag)
if: success()
uses: actions-hub/docker/cli@master
with:
args: push exelban/baseimage:${IMAGE_TAG}
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# baseimage
[![Travis build status](https://travis-ci.org/exelban/baseimage.svg?branch=master)](https://travis-ci.org/exelban/baseimage)
[![DockerHub build status](https://img.shields.io/docker/build/exelban/baseimage.svg)](https://hub.docker.com/r/exelban/baseimage/builds/)

Docker images for golang and nodeJS projects.

Expand Down Expand Up @@ -34,7 +32,7 @@ Image based on golang:1.12-alpine.
Added tzdata git packages for time and fetching projects from git.

Installed tools:
* dep
* golangci-lint

### Size
Compressed: 180MB
Expand Down

0 comments on commit bee8d2f

Please sign in to comment.