checkly #138
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: checkly | |
on: [deployment_status] | |
env: | |
ENVIRONMENT_URL: ${{ github.event.deployment_status.environment_url }} | |
DEPLOYMENT_ID: ${{ github.event.deployment.id }} | |
DEPLOYMENT_ENVIRONMENT: ${{ github.event.deployment_status.environment }} | |
DEPLOYMENT_CREATOR_NAME: ${{ github.event.deployment_status.creator.name }} | |
CHECKLY_API_KEY: ${{ secrets.CHECKLY_API_KEY }} | |
CHECKLY_ACCOUNT_ID: ${{ secrets.CHECKLY_ACCOUNT_ID }} | |
jobs: | |
test-e2e: | |
if: github.event.deployment_status.state == 'success' | |
name: Test E2E on Checkly | |
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: npm ci | |
- name: Run checks | |
id: run-checks | |
run: npm run checkly:test -- -e ENVIRONMENT_URL=${{ env.ENVIRONMENT_URL }} | |
continue-on-error: false | |
- name: Deploy checks | |
if: steps.run-checks.outcome == 'success' && env.DEPLOYMENT_ENVIRONMENT == 'Production' | |
run: npm run checkly:deploy |