Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for deployment_status events to github action #1127

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

carbonrobot
Copy link

@carbonrobot carbonrobot commented Dec 2, 2024

Support the deployment_status event type for Github Actions.

This allows consumers to support running Playwright or Cypress tests after a deployment is complete to a third party platform such as Vercel when using the action in the same workflow file.

Fixes #647

Example Configuration

The following configuration currently exits with an error for unsupported event type. This PR fixes the error.

name: Chromatic

on:
  deployment_status:
  
jobs:
  playwright:
    container:
      image: mcr.microsoft.com/playwright:v1.49.0-jammy
    steps:
      - uses: actions/checkout@v4
      
      - name: Run Playwright Tests
        run: npx playwright test
        env:
          PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }}
          
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: playwright-results
          path: ./playwright-report
          retention-days: 30

  chromatic:
    name: Run Chromatic
    needs: playwright
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4 
      
      - uses: actions/download-artifact@v4
        with:
          path: ${{ github.workspace }}
          
      - name: Chromatic
        uses: chromaui/action@latest
        with:
          playwright: true
          projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

@carbonrobot
Copy link
Author

carbonrobot commented Dec 3, 2024

Currently blocked by the same problem with deployment_status missing the branch ref as describe in actions/cache#319; but exploring workarounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chroma GH Action
1 participant