Skip to content

Workflow file for this run

name: 👩🏻‍🚀 MAIN -> E2E Tests + Preview Deploy (Frontend)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
DEPLOY_PR_FROM_FORK: true
on:
pull_request_target:
types: [opened, synchronize, reopened]
branches:
- main
jobs:
# cypress-run:
# runs-on: ubuntu-latest
# # use docker container to run tests
# container: cypress/browsers:node18.12.0-chrome107
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Install npm
# run: npm install -g husky
# - name: set environment variables
# uses: allenevans/[email protected]
# with:
# HUSKY: 0
# - name: "Cypress Tests - Chrome"
# uses: cypress-io/[email protected]
# with:
# install: true
# build: npm run build
# start: npm run dev
# wait-on: "http://localhost:3000"
# wait-on-timeout: 120
# browser: chrome
# spec: cypress/e2e/*
# env:
# CI: "false"
Deploy-Preview:
# needs: cypress-run
# if: success()
runs-on: ubuntu-latest
steps:
- id: script
uses: actions/github-script@v3
with:
script: |
const isPr = [ 'pull_request', 'pull_request_target' ].includes(context.eventName)
core.setOutput('ref', isPr ? context.payload.pull_request.head.ref : context.ref)
core.setOutput('repo', isPr ? context.payload.pull_request.head.repo.full_name : context.repo.full_name)
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ steps.script.outputs.repo }}
- name: Create Branch
uses: peterjgrainger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: "${{ github.event.pull_request.head.ref }}"
sha: "${{ github.event.pull_request.head.sha }}"
- name: Deploy to Vercel Action
uses: BetaHuhn/deploy-to-vercel-action@latest
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
DEPLOY_PR_FROM_FORK: true
DELETE_EXISTING_COMMENT: true
PR_LABELS: false