version: v1.0
name: Deploy to DockerHub
blocks:
  - name: Deploy to DockerHub
    task:
      jobs:
        - name: Deploy
          commands:
            - checkout
            - export TAG=$(echo ${SEMAPHORE_GIT_TAG_NAME:-vlatest} |cut -c 2-)
            - 'docker build -t "devicefarmer/stf:$TAG" .'
            - docker push devicefarmer/stf:$TAG
      secrets:
        - name: dockerhub-secrets
      prologue:
        commands:
          - 'echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin'
    dependencies: []
agent:
  machine:
    type: e1-standard-2
    os_image: ubuntu2004
