Merge pull request #348 from codex-team/fix/codexui #11
This file contains hidden or 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: Publish CodeX UI to NPM | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '@codexteam/ui/**' | |
| jobs: | |
| publish-ui: | |
| name: Publish @codexteam/ui package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js from .nvmrc | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: Install dependencies | |
| working-directory: '@codexteam/ui' | |
| run: yarn install | |
| - name: Build package | |
| working-directory: '@codexteam/ui' | |
| run: yarn build | |
| - name: Publish package to npm | |
| working-directory: '@codexteam/ui' | |
| run: yarn npm publish --access public | |
| env: | |
| YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| notify: | |
| name: Notify in CodexBot | |
| needs: publish-ui | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Get UI package info | |
| id: ui-package | |
| uses: codex-team/action-nodejs-package-info@v1 | |
| with: | |
| package_json_path: '@codexteam/ui/package.json' | |
| - name: Send a message | |
| uses: codex-team/action-codexbot-notify@v1 | |
| with: | |
| webhook: ${{ secrets.CODEX_BOT_WEBHOOK_HAWK }} | |
| message: | | |
| [${{ steps.ui-package.outputs.name }}](${{ steps.ui-package.outputs.npmjs-link }}) v${{ steps.ui-package.outputs.version }} was published | |
| parse_mode: markdown | |
| disable_web_page_preview: true |