Skip to content

cypress-test-on-vercel-preview #77

cypress-test-on-vercel-preview

cypress-test-on-vercel-preview #77

name: cypress-test-on-vercel-preview
on: [deployment_status]
jobs:
vercel-preview-e2e:
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success' && github.event.deployment_status.environment == 'Preview'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: use-node-${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: dump-github-context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo "$GITHUB_CONTEXT"
- name: install-dependencies
run: npm ci --loglevel verbose
- name: print-preview-url
run: echo ${{ github.event.deployment_status.target_url }}
- name: run-cypress-tests-on-vercel-preview
run: npm run cypress-test-on-vercel-preview
env:
VERCEL_PREVIEW_URL: ${{ github.event.deployment_status.target_url }}