reusable-app-reg-suit.yml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. name: Reusable build app workflow for production
  2. on:
  3. workflow_call:
  4. inputs:
  5. node-version:
  6. required: true
  7. type: string
  8. checkout-ref:
  9. type: string
  10. default: ${{ github.head_ref }}
  11. skip-reg-suit:
  12. type: boolean
  13. cypress-report-artifact-name-pattern:
  14. required: true
  15. type: string
  16. secrets:
  17. REG_NOTIFY_GITHUB_PLUGIN_CLIENTID:
  18. required: true
  19. AWS_ACCESS_KEY_ID:
  20. required: true
  21. AWS_SECRET_ACCESS_KEY:
  22. required: true
  23. SLACK_WEBHOOK_URL:
  24. required: true
  25. outputs:
  26. EXPECTED_IMAGES_EXIST:
  27. value: ${{ jobs.run-reg-suit.outputs.EXPECTED_IMAGES_EXIST }}
  28. jobs:
  29. run-reg-suit:
  30. # use secrets for "VRT" environment
  31. # https://github.com/weseek/growi/settings/environments/376165508/edit
  32. environment: VRT
  33. if: ${{ !inputs.skip-reg-suit }}
  34. env:
  35. REG_NOTIFY_GITHUB_PLUGIN_CLIENTID: ${{ secrets.REG_NOTIFY_GITHUB_PLUGIN_CLIENTID }}
  36. AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
  37. AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  38. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  39. runs-on: ubuntu-latest
  40. outputs:
  41. EXPECTED_IMAGES_EXIST: ${{ steps.check-expected-images.outputs.EXPECTED_IMAGES_EXIST }}
  42. steps:
  43. - uses: actions/checkout@v4
  44. with:
  45. ref: ${{ inputs.checkout-ref }}
  46. fetch-depth: 0
  47. - uses: actions/setup-node@v4
  48. with:
  49. node-version: ${{ inputs.node-version }}
  50. cache: 'yarn'
  51. cache-dependency-path: '**/yarn.lock'
  52. - name: Restore node_modules
  53. uses: actions/cache/restore@v4
  54. with:
  55. path: |
  56. **/node_modules
  57. # saved key by launch-prod
  58. key: node_modules-app-launch-prod-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}
  59. restore-keys: |
  60. node_modules-app-launch-prod-${{ runner.OS }}-node${{ inputs.node-version }}-
  61. - name: Install dependencies
  62. run: |
  63. yarn global add node-gyp
  64. yarn --frozen-lockfile
  65. - name: Download screenshots taken by cypress
  66. uses: actions/download-artifact@v4
  67. with:
  68. path: apps/app/test/cypress
  69. pattern: ${{ inputs.cypress-report-artifact-name-pattern }}
  70. merge-multiple: true
  71. - name: Run reg-suit
  72. working-directory: ./apps/app
  73. run: |
  74. yarn reg:run
  75. - name: Slack Notification
  76. uses: weseek/ghaction-slack-notification@master
  77. if: failure()
  78. with:
  79. type: ${{ job.status }}
  80. job_name: '*Node CI for growi - run-reg-suit (${{ inputs.node-version }})*'
  81. channel: '#ci'
  82. isCompactMode: true
  83. url: ${{ secrets.SLACK_WEBHOOK_URL }}