Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gp187 authored Apr 10, 2020
1 parent 2ab9f52 commit 41d02c7
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deploy to docker hub

on:
push:
branches:
- master
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- 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 ${GITHUB_REPOSITORY}:${IMAGE_TAG} .

- name: Push to docker registry
if: success()
uses: actions-hub/docker@master
with:
args: push ${GITHUB_REPOSITORY}:${IMAGE_TAG}
- name: Push to docker registry as :latest
if: success()
uses: actions-hub/docker@master
with:
args: push ${GITHUB_REPOSITORY}:latest

0 comments on commit 41d02c7

Please sign in to comment.