name: Run E2E tests k8s

on:
  pull_request_review:
    types: [submitted]
  workflow_dispatch:

env:
  K8S_LOCAL_PORT: ${{ secrets.K8S_LOCAL_PORT }}
  K8S_HOST: ${{ secrets.K8S_HOST }}
  BASTION_HOST: ${{ secrets.BASTION_HOST }}
  K8S_PORT: ${{ secrets.K8S_PORT }}
  USERNAME: ${{ secrets.USERNAME }}
  BASTION_SSH_KEY: ${{secrets.BASTION_SSH_KEY}}

jobs:
  deploy_and_tests:
    if: github.event.review.state == 'approved'
    # needs: push_to_registry
    uses: blockscout/blockscout-ci-cd/.github/workflows/e2e_new.yaml@master
    with:
      appNamespace: e2e-front-$GITHUB_SHA_SHORT
      frontendImage: ghcr.io/blockscout/frontend:prerelease-$GITHUB_REF_NAME_SLUG
      blockscoutIngressHost: e2e-blockscout-$GITHUB_SHA_SHORT
      frontendIngressHost: e2e-blockscout-$GITHUB_SHA_SHORT
      gethIngressHost: e2e-geth-$GITHUB_SHA_SHORT
      scVerifierIngressHost: e2e-sc-verifier-$GITHUB_SHA_SHORT
    secrets: inherit
