name: Publish Dockerhub
on:
  release:
    types: [published]
jobs:
  update:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Get release version
      id: get_version
      run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:10})
    - name: Publish to Dockerhub
      uses: elgohr/Publish-Docker-Github-Action@master
      with:
        name: hkalexling/mango
        username: ${{ secrets.DOCKER_USERNAME }}
        password: ${{ secrets.DOCKER_PASSWORD }}
        tags: "latest,${{ env.RELEASE_VERSION }}"
