feat(mui-spaces): update hooks dependency to v7 #2089
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: Deploy PR previews | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - closed | |
| concurrency: preview-${{ github.event.number }} | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| deploy-preview: | |
| if: ${{ github.event.action != 'closed' && github.actor != 'dependabot[bot]' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Derive appropriate SHAs for base and head for `nx affected` commands | |
| uses: nrwl/nx-set-shas@afb73a62d26e41464e9254689e1fd6122ee683c1 # v5.0.1 | |
| - name: Set Node Version | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 24 | |
| cache: 'yarn' | |
| cache-dependency-path: 'yarn.lock' | |
| - name: Install Dependencies | |
| run: yarn install --immutable | |
| - name: Build Packages | |
| run: yarn build | |
| - name: Build Docs | |
| run: yarn build:storybook:ci | |
| - name: Deploy PR Preview | |
| uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: dist/storybook | |
| destination_dir: pr-preview/pr-${{ github.event.number }} | |
| keep_files: true | |
| enable_jekyll: false | |
| - name: Comment PR | |
| uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 | |
| with: | |
| script: | | |
| const body = '🚀 **Preview deployed!**\n\n📖 [View Storybook Preview](https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/pr-preview/pr-${{ github.event.number }}/)'; | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| }); | |
| const existing = comments.find(c => c.body.includes('View Storybook Preview')); | |
| if (existing) { | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: existing.id, | |
| body, | |
| }); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body, | |
| }); | |
| } | |
| cleanup-preview: | |
| if: ${{ github.event.action == 'closed' && github.actor != 'dependabot[bot]' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout gh-pages | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| with: | |
| ref: gh-pages | |
| - name: Remove PR preview | |
| run: | | |
| if [ -d "pr-preview/pr-${{ github.event.number }}" ]; then | |
| rm -rf pr-preview/pr-${{ github.event.number }} | |
| git config user.email ${{ secrets.GH_EMAIL }} | |
| git config user.name ${{ secrets.GH_USER }} | |
| git add . | |
| git commit -m "Remove preview for PR #${{ github.event.number }}" | |
| git push | |
| else | |
| echo "Preview directory not found, nothing to clean up" | |
| fi |