Skip to content

Commit

Permalink
Create Github action for publish docker image on release
Browse files Browse the repository at this point in the history
  • Loading branch information
bytesnz committed Jan 9, 2021
1 parent 5bec28c commit cc0a42c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/docker-hub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Docker Image CI

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Build and publish Docker image
run: |
export VERSION=$(echo $GITHUB_REF | sed -re 's/^.*\/([0-9a-zA-Z._-]+)$/\1/')
test "$VERSION" != "$GITHUB_REF"
docker build --file docker/Dockerfile --tag $DOCKER_USER/armadietto:$VERSION .
docker login -u $DOCKER_USER -p $DOCKER_TOKEN
docker push $DOCKER_USER/armadietto:$VERSION

0 comments on commit cc0a42c

Please sign in to comment.