screenshots.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. - uses: actions/checkout@v4
  15. - uses: actions/setup-go@v4
  16. with:
  17. go-version: '1.21'
  18. cache: true
  19. - name: Cache node modules
  20. uses: actions/cache@v3
  21. env:
  22. cache-name: cache-node-modules-screenshots
  23. with:
  24. path: ~/.npm
  25. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('test/automated/screenshots/package-lock.json') }}
  26. restore-keys: |
  27. ${{ runner.os }}-build-${{ env.cache-name }}-
  28. ${{ runner.os }}-build-
  29. ${{ runner.os }}-
  30. - name: Automate screenshots
  31. uses: nick-fields/retry@v2
  32. with:
  33. timeout_minutes: 10
  34. max_attempts: 4
  35. command: cd test/automated/screenshots && ./run.sh
  36. - name: Commit changes
  37. uses: EndBug/add-and-commit@v9
  38. with:
  39. author_name: Owncast
  40. author_email: owncast@owncast.online
  41. message: 'Commit screenshots'
  42. add: '*.png'
  43. pull: '--rebase --autostash'
  44. env:
  45. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  46. - name: Dispatch event to web site
  47. uses: peter-evans/repository-dispatch@v2
  48. with:
  49. token: ${{ secrets.BUNDLE_STORYBOOK_OWNCAST_ONLINE }}
  50. repository: owncast/owncast.github.io
  51. event-type: bundle-components-library