| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- name: Reusable build app workflow for production
- on:
- workflow_call:
- inputs:
- node-version:
- required: true
- type: string
- checkout-ref:
- type: string
- default: ${{ github.head_ref }}
- skip-reg-suit:
- type: boolean
- cypress-report-artifact-name-pattern:
- required: true
- type: string
- secrets:
- REG_NOTIFY_GITHUB_PLUGIN_CLIENTID:
- required: true
- AWS_ACCESS_KEY_ID:
- required: true
- AWS_SECRET_ACCESS_KEY:
- required: true
- SLACK_WEBHOOK_URL:
- required: true
- outputs:
- EXPECTED_IMAGES_EXIST:
- value: ${{ jobs.run-reg-suit.outputs.EXPECTED_IMAGES_EXIST }}
- jobs:
- run-reg-suit:
- # use secrets for "VRT" environment
- # https://github.com/weseek/growi/settings/environments/376165508/edit
- environment: VRT
- if: ${{ !inputs.skip-reg-suit }}
- env:
- REG_NOTIFY_GITHUB_PLUGIN_CLIENTID: ${{ secrets.REG_NOTIFY_GITHUB_PLUGIN_CLIENTID }}
- AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
- AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- runs-on: ubuntu-latest
- outputs:
- EXPECTED_IMAGES_EXIST: ${{ steps.check-expected-images.outputs.EXPECTED_IMAGES_EXIST }}
- steps:
- - uses: actions/checkout@v4
- with:
- ref: ${{ inputs.checkout-ref }}
- fetch-depth: 0
- - uses: actions/setup-node@v4
- with:
- node-version: ${{ inputs.node-version }}
- cache: 'yarn'
- cache-dependency-path: '**/yarn.lock'
- - name: Restore node_modules
- uses: actions/cache/restore@v4
- with:
- path: |
- **/node_modules
- # saved key by launch-prod
- key: node_modules-app-launch-prod-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}
- restore-keys: |
- node_modules-app-launch-prod-${{ runner.OS }}-node${{ inputs.node-version }}-
- - name: Install dependencies
- run: |
- yarn global add node-gyp
- yarn --frozen-lockfile
- - name: Download screenshots taken by cypress
- uses: actions/download-artifact@v4
- with:
- path: apps/app/test/cypress
- pattern: ${{ inputs.cypress-report-artifact-name-pattern }}
- merge-multiple: true
- - name: Run reg-suit
- working-directory: ./apps/app
- run: |
- yarn reg:run
- - name: Slack Notification
- uses: weseek/ghaction-slack-notification@master
- if: failure()
- with:
- type: ${{ job.status }}
- job_name: '*Node CI for growi - run-reg-suit (${{ inputs.node-version }})*'
- channel: '#ci'
- isCompactMode: true
- url: ${{ secrets.SLACK_WEBHOOK_URL }}
|