#
# Copyright (c) 2020-2021 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
name: Next Dockerimage

on:
  push:
    branches: [ main ]

jobs:

  build:
    runs-on: ubuntu-20.04
    steps:
    - name: Checkout web-terminal-exec source code
      uses: actions/checkout@v2

    - name: "Docker Quay.io Login with WTO Robot"
      env:
        DOCKER_USERNAME: ${{ secrets.QUAY_USERNAME }}
        DOCKER_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
      run: |
        echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin quay.io
    
    - name: "Docker build and push"
      run: |
        docker build -f ./build/dockerfiles/Dockerfile -t quay.io/wto/web-terminal-exec:next .
        docker push quay.io/wto/web-terminal-exec:next
