fix build #1894
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Plugin automations UI CI | |
on: | |
push: | |
branches: | |
- dev | |
- master | |
- rc | |
- staging | |
- build-test | |
paths: | |
- 'packages/erxes-ui/**' | |
- 'packages/ui-plugin-template/**' | |
- 'packages/ui-cards/**' | |
- 'packages/ui-forms/**' | |
- 'packages/ui-inbox/**' | |
- 'packages/ui-knowledgebase/**' | |
- 'packages/ui-leads/**' | |
- 'packages/ui-log/**' | |
- 'packages/ui-notifications/**' | |
- 'packages/ui-products/**' | |
- 'packages/ui-segments/**' | |
- 'packages/ui-settings/**' | |
- 'packages/ui-team/**' | |
- 'packages/ui-tags/**' | |
- 'packages/ui-automations/**' | |
- 'packages/plugin-automations-ui/**' | |
- '.github/workflows/plugin-automations-ui.yaml' | |
pull_request: | |
branches: | |
- dev | |
- master | |
- rc | |
- staging | |
- build-test | |
paths: | |
- 'packages/erxes-ui/**' | |
- 'packages/ui-plugin-template/**' | |
- 'packages/ui-cards/**' | |
- 'packages/ui-forms/**' | |
- 'packages/ui-inbox/**' | |
- 'packages/ui-knowledgebase/**' | |
- 'packages/ui-leads/**' | |
- 'packages/ui-log/**' | |
- 'packages/ui-notifications/**' | |
- 'packages/ui-products/**' | |
- 'packages/ui-segments/**' | |
- 'packages/ui-settings/**' | |
- 'packages/ui-team/**' | |
- 'packages/ui-tags/**' | |
- 'packages/ui-automations/**' | |
- 'packages/plugin-automations-ui/**' | |
- '.github/workflows/plugin-automations-ui.yaml' | |
jobs: | |
ui: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 18.17.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.17.x | |
# https://github.com/actions/cache/blob/main/examples.md#node---yarn | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn # since the yarn install runs at workspace level | |
restore-keys: | | |
${{ runner.os }}-yarn | |
- name: Build | |
run: | | |
yarn install --frozen-lockfile | |
cd packages/plugin-automations-ui | |
yarn build | |
cp -r ./src/locales/ ./dist/locales 2>/dev/null || true | |
- name: Configure AWS credentials | |
if: github.event_name == 'push' && ( github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/build-test') | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-west-2 | |
- name: Deploy | |
if: github.event_name == 'push' && ( github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/build-test') | |
run: | | |
tar -cf build.tar --directory=packages/plugin-automations-ui/dist . | |
cp build.tar packages/plugin-automations-ui/dist | |
aws s3 sync packages/plugin-automations-ui/dist s3://erxes-${GITHUB_REF#refs/heads/}-plugins/uis/plugin-automations-ui --delete |