Skip to content

Commit

Permalink
Add Docker image deploy on tag
Browse files Browse the repository at this point in the history
Signed-off-by: m09 <[email protected]>
  • Loading branch information
m09 committed Jan 27, 2020
1 parent 1553043 commit 3237d51
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CD

on:
push:
tags:
- "*"

jobs:
deploy:
name: Deploy to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Build and tag Docker image
run: >-
export TAG=${${{ github.ref }}##*/}
echo Building for tag "$TAG"
docker build -t $IMG_NAME:$TAG .
docker tag $IMG_NAME:$TAG $IMG_NAME:latest
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_LOGIN }}" --password-stdin
docker push $IMG_NAME
env:
- IMG_NAME: mloncode/workshop

0 comments on commit 3237d51

Please sign in to comment.