Skip to content

Checkly Preview Test #138

Checkly Preview Test

Checkly Preview Test #138

# This GitHub Actions workflow triggers after receiving a Deployment Status event from GH Actions environment. This works
# with providers like Vercel, Heroku and others. This workflow does the following
# - Runs after deployment event
# - Uses the target_url provided in the deployment event
# - Dry run all the checks on Checkly
# - If the dry run passes, deploy the checks.
#
# You can of course trigger the Checkly CLI in other workflows or steps inside your GH Action configuration.
name: Checkly Preview Test
on: [deployment_status]
env:
ENVIRONMENT_URL: ${{ github.event.deployment_status.target_url }}
CHECKLY_API_KEY: ${{ secrets.CHECKLY_API_KEY }}
CHECKLY_ACCOUNT_ID: ${{ secrets.CHECKLY_ACCOUNT_ID }}
jobs:
test-e2e:
if: |
github.event.deployment_status.state == 'success' &&
!contains(github.event.deployment_status.target_url, 'backend')
timeout-minutes: 10
name: Checkly Preview Deploy Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Restore or cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: cd next-webstore && npm ci
- name: Run checks
id: run-checks
working-directory: next-webstore
run: NEXT_PUBLIC_NODE_PREVIEW=preview npx checkly test -e NEXT_PUBLIC_NODE_PREVIEW=preview NEXT_PUBLIC_ENVIRONMENT_URL=${{ env.ENVIRONMENT_URL}} --record
continue-on-error: false