# This is a basic workflow to help you get started with Actions

name: Publish Docker image

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
  release:
    types: [ published ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  push_to_registry:
    name: Push Docker image to Docker Hub
    runs-on: ubuntu-latest
    steps:
      - name: Check out the repo
        uses: actions/checkout@v2
      - name: Push to Docker Hub
        if: "!github.event.release.prerelease"
        uses: docker/build-push-action@v1
        with:
          username: ${{ secrets.CADENCE_WEB_DOCKERHUB_USERNAME }}
          password: ${{ secrets.CADENCE_WEB_DOCKERHUB_TOKEN }}
          repository: ubercadence/web
          tag_with_ref: true
          tags: latest
