Skip to content

Workflow file for this run

name: Cypress E2E Tests on Netlify Preview
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 18
- name: Install dependencies
run: npm install
- name: Build your React app (if needed)
run: npm run build
- name: Deploy to Netlify
run: npx netlify-cli deploy --prod
- name: Get the Netlify Deploy URL
id: netlify-deploy
run: echo "::set-output name=url::$(npx netlify-cli open:site)"
- name: Run Cypress tests
run: |
npx cypress run --config baseUrl=${{ steps.netlify-deploy.outputs.url }}
- name: Upload Cypress screenshots and videos
uses: actions/upload-artifact@v2
with:
name: cypress-artifacts
path: cypress/screenshots, cypress/videos