fix(Layout): fix panel header props type #2358
Workflow file for this run
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: Pull Request | |
| on: | |
| pull_request: | |
| paths-ignore: | |
| - '.changeset/**' | |
| - '.husky/**' | |
| concurrency: | |
| group: ci-pull-request=${{github.ref}}-1 | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read # Read-only access to repository contents | |
| issues: write # Write access to issues | |
| pull-requests: write # Write access to pull requests | |
| statuses: write # Write access to commit statuses | |
| actions: write # Required to trigger workflows | |
| jobs: | |
| build: | |
| name: 'Build' | |
| runs-on: ubuntu-latest | |
| env: | |
| NODE_OPTIONS: --max-old-space-size=4096 | |
| outputs: | |
| version: ${{ steps.version.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Update Corepack | |
| run: npm i -g corepack@latest | |
| - name: Enable Corepack (pre) | |
| run: corepack enable | |
| - name: Prepare pnpm (pre) | |
| run: corepack prepare [email protected] --activate | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'pnpm' | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Prepare pnpm | |
| run: corepack prepare [email protected] --activate | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Set env | |
| run: echo "SHORT_SHA=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV | |
| - name: Increment canary | |
| run: npm version 0.0.0-canary-$SHORT_SHA --no-git-tag-version | |
| - name: Build project | |
| run: pnpm build | |
| - name: Get version | |
| id: version | |
| working-directory: ./dist | |
| run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: ./dist | |
| retention-days: 7 | |
| trigger-publish: | |
| name: 'Trigger canary publish' | |
| needs: build | |
| if: github.actor == 'tenphi' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Trigger publish workflow | |
| uses: actions/github-script@v6 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| await github.rest.actions.createWorkflowDispatch({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| workflow_id: 'publish.yml', | |
| ref: 'main', | |
| inputs: { | |
| type: 'canary', | |
| pr_number: String(context.payload.pull_request.number), | |
| run_id: String(context.runId) | |
| } | |
| }) | |
| console.log('Triggered publish workflow for canary release') | |
| tests: | |
| name: 'Tests & lint' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Update Corepack | |
| run: npm i -g corepack@latest | |
| - name: Enable Corepack (pre) | |
| run: corepack enable | |
| - name: Prepare pnpm (pre) | |
| run: corepack prepare [email protected] --activate | |
| - uses: actions/cache@v4 | |
| name: Download eslint cache | |
| with: | |
| path: | | |
| **/.eslintcache | |
| key: ${{ runner.os }}-eslint | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'pnpm' | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Prepare pnpm | |
| run: corepack prepare [email protected] --activate | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run the lint | |
| run: pnpm lint | |
| - name: Run the tests | |
| run: pnpm test:no-cache | |
| deploy-chromatic: | |
| name: 'Prepare Storybook for review & tests' | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: Chromatic staging | |
| url: ${{ steps.publish_chromatic.outputs.url }} | |
| env: | |
| CHROMATIC_RETRIES: 5 | |
| LOG_LEVEL: 'error' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Update Corepack | |
| run: npm i -g corepack@latest | |
| - name: Enable Corepack (pre) | |
| run: corepack enable | |
| - name: Prepare pnpm (pre) | |
| run: corepack prepare [email protected] --activate | |
| - uses: actions/cache@v4 | |
| name: Download storybook cache | |
| with: | |
| path: | | |
| **/node_modules/.cache | |
| key: ${{ runner.os }}-storybook-${{ github.run_id }} | |
| restore-keys: | | |
| ${{ runner.os }}-storybook | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'pnpm' | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Prepare pnpm | |
| run: corepack prepare [email protected] --activate | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Publish to Chromatic | |
| id: publish_chromatic | |
| uses: chromaui/action@v11 | |
| with: | |
| exitZeroOnChanges: true | |
| exitOnceUploaded: true | |
| onlyChanged: true | |
| debug: true | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
| - name: Comment PR | |
| uses: actions/github-script@v6 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const setMessage = require('${{ github.workspace }}/scripts/ci/set-message.cjs') | |
| await setMessage({ | |
| header: "## 🧪 Storybook is successfully deployed!", | |
| body: ` | |
| - 👀 Review changes: ${{ steps.publish_chromatic.outputs.url }} | |
| - 👨🎨 Preview storybook: ${{ steps.publish_chromatic.outputs.storybookUrl }} | |
| `, | |
| github, | |
| repo: context.repo, | |
| prNumber: context.payload.pull_request.number | |
| }) |