screenshots.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. name: Take nightly screenshots
  2. on:
  3. schedule:
  4. - cron: '0 4 * * *'
  5. env:
  6. BROWSERSTACK_KEY: ${{ secrets.BROWSERSTACK_KEY }}
  7. BROWSERSTACK_PASSWORD: ${{ secrets.BROWSERSTACK_PASSWORD }}
  8. BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
  9. TEST_URL: http://localhost:8080
  10. jobs:
  11. Screenshots:
  12. runs-on: ubuntu-latest
  13. steps:
  14. - name: Check out pull request code
  15. uses: actions/checkout@v4
  16. if: github.event_name == 'pull_request'
  17. with:
  18. repository: ${{ github.event.pull_request.head.repo.full_name }}
  19. - name: Check out repository code
  20. uses: actions/checkout@v4
  21. if: github.event_name == 'push'
  22. - uses: actions/setup-go@v5
  23. with:
  24. go-version: '1.22'
  25. cache: true
  26. - name: Cache node modules
  27. uses: actions/cache@v4
  28. env:
  29. cache-name: cache-node-modules-screenshots
  30. with:
  31. path: ~/.npm
  32. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('test/automated/screenshots/package-lock.json') }}
  33. restore-keys: |
  34. ${{ runner.os }}-build-${{ env.cache-name }}-
  35. ${{ runner.os }}-build-
  36. ${{ runner.os }}-
  37. - name: Automate screenshots
  38. uses: nick-fields/retry@v3
  39. with:
  40. timeout_minutes: 10
  41. max_attempts: 4
  42. command: cd test/automated/screenshots && ./run.sh
  43. - name: Commit changes
  44. uses: EndBug/add-and-commit@v9
  45. with:
  46. author_name: Owncast
  47. author_email: owncast@owncast.online
  48. message: 'Commit screenshots'
  49. add: '*.png'
  50. pull: '--rebase --autostash'
  51. env:
  52. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  53. - name: Dispatch event to web site
  54. uses: peter-evans/repository-dispatch@v3
  55. with:
  56. token: ${{ secrets.BUNDLE_STORYBOOK_OWNCAST_ONLINE }}
  57. repository: owncast/owncast.github.io
  58. event-type: bundle-components-library