# Multiple deployments pipelines are custom per asset. All single deployments pipelines are handled by vib-verify.yaml
name: 'VIB'
on: # rebuild any PRs and main branch changes
  pull_request_target:
    types:
      - opened
      - reopened
      - synchronize
      - labeled
    branches:
      - master
    paths:
      - 'bitnami/redis/*'
env:
  CSP_API_URL: https://console.cloud.vmware.com
  CSP_API_TOKEN: ${{ secrets.CSP_API_TOKEN }}
  VIB_PUBLIC_URL: https://cp.bromelia.vmware.com
jobs:
  vib-verify-sentinel:
    if: ${{ contains(github.event.pull_request.labels.*.name, 'verify') }}
    runs-on: ubuntu-latest
    name: Verify Redis Sentinel on Tanzu Kubernetes Grid
    steps:
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.event.pull_request.head.ref }}
          repository: ${{ github.event.pull_request.head.repo.full_name }}
      - uses: vmware-labs/vmware-image-builder-action@main
        with:
          pipeline: redis/sentinel/vib-verify.json
        env:
          VIB_ENV_TARGET_PLATFORM: ${{ secrets.VIB_ENV_TARGET_PLATFORM }}

  vib-verify-replica:
    if: ${{ contains(github.event.pull_request.labels.*.name, 'verify') }}
    runs-on: ubuntu-latest
    name: Verify Redis Replica on Tanzu Kubernetes Grid
    steps:
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.event.pull_request.head.ref }}
          repository: ${{ github.event.pull_request.head.repo.full_name }}
      - uses: vmware-labs/vmware-image-builder-action@main
        with:
          pipeline: redis/replicas/vib-verify.json
        env:
          VIB_ENV_TARGET_PLATFORM: ${{ secrets.VIB_ENV_TARGET_PLATFORM }}
