#!/usr/bin/env groovy

pipeline {
  agent any
  options {
    timeout(time: 6, unit: 'HOURS')
    timestamps()
    ansiColor('xterm')
  }

  environment {
    AWS_DEFAULT_REGION = 'us-west-2'
    EB_APP_NAME = 'grid-ui'
  }

  stages {
    stage('Publish Artifact') {
      when { not { changeRequest() } } // only publish on branch, not PR - prevent duplicates
      steps {
        script {
          sh './scripts/upload_artifacts.sh'
        }
      }
    }
  }
  post {
    always {
      cleanWs()
    }
  }
}
