pipeline {
  agent any

  stages {
    stage('Clone repository') {
      checkout scm
    }

    stage('Build image') {
      app = docker.build("efstajas/homepage")
    }

    stage('Push image') {
      docker.withRegistry('https://registry.hub.docker.com', 'git') {
        app.push("${env.BUILD_NUMBER}")
        app.push("latest")
      }
    }
  }
}
