version: v1.0
name: Deploy to production
agent:
  machine:
    type: e1-standard-2
    os_image: ubuntu2004
blocks:
  - name: Docker
    task:
      jobs:
        - name: Build, publish, deploy
          commands:
            - checkout
            - echo $DOCKERHUB_PASSWORD | docker login --username "$DOCKERHUB_USERNAME" --password-stdin
            - 'docker build -f Dockerfile.production -t etengine:latest .'
            - 'docker tag etengine:latest quintel/etengine:latest'
            - 'docker push quintel/etengine:latest'
            - ssh -o "StrictHostKeyChecking=no" -i ~/.ssh/id_deploy deploy@23.88.68.183 "cd /var/www/etengine && docker-compose pull && docker-compose run --rm web .docker/calculate-datasets.sh && docker-compose down && docker-compose up -d"
      secrets:
        - name: Deploy Key
        - name: Docker Hub Credentials
    run:
      when: branch = 'docker'

version: v1.0
name: Deploy to production
agent:
  machine:
    type: e1-standard-2
    os_image: ubuntu2004
blocks:
  - name: Docker
    task:
      jobs:
        - name: Build, publish, deploy
          commands:
            - checkout
            - echo $DOCKERHUB_PASSWORD | docker login --username "$DOCKERHUB_USERNAME" --password-stdin
            - 'docker build -f Dockerfile.production -t etengine:latest .'
            - 'docker tag etengine:latest quintel/etengine:latest'
            - 'docker push quintel/etengine:latest'
            - ssh -o "StrictHostKeyChecking=no" -i ~/.ssh/id_deploy deploy@23.88.68.183 "cd /var/www/etengine && docker-compose pull && docker-compose run --rm web .docker/calculate-datasets.sh && docker-compose down && docker-compose up -d"
      secrets:
        - name: Deploy key
        - name: Docker Hub credentials
    run:
      when: branch = 'docker'

Fix secret names in Semaphore config
Fix secret names in Semaphore config
