Skip to content

Instantly share code, notes, and snippets.

@mattbloomfield
Created March 26, 2021 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattbloomfield/cf831a3075b188805083fc822a83cc9c to your computer and use it in GitHub Desktop.
Save mattbloomfield/cf831a3075b188805083fc822a83cc9c to your computer and use it in GitHub Desktop.
Github Action to Trigger Cypress Test in its own environment using inputs from remote source
# .github/workflows/cypress.yml
name: Manually Triggered Cypress Tests with installation job
on:
workflow_dispatch:
inputs:
baseUrl:
description: 'Testing Domain'
required: true
default: 'https://www.uschamber.com'
title:
description: 'Merge Comment'
required: true
default: 'Running Cypress Tests'
jobs:
cypress-run:
runs-on: ubuntu-16.04
steps:
- name: Checkout
uses: actions/checkout@v2
# Install NPM dependencies, cache them correctly
# and run all Cypress tests
- name: Cypress run
uses: cypress-io/github-action@v2
with:
record: true
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CYPRESS_baseUrl: ${{ github.event.inputs.baseUrl }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_INFO_MESSAGE: ${{ github.event.inputs.title }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment