feat: bottom sheet prototype #331
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: Deploy PR Preview | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| pull-requests: write | |
| contents: read | |
| jobs: | |
| deploy-preview: | |
| runs-on: ubuntu-latest | |
| name: Deploy PR Preview | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - name: Install Dependencies | |
| run: | | |
| bun install | |
| cd playground && bun install | |
| - name: Build Library | |
| run: bun run build | |
| - name: Build Playground | |
| run: cd playground && bun run build | |
| - name: Deploy to Surge | |
| env: | |
| SURGE_TOKEN: 256124bc72b634a53b5d5ec5f0c02258 | |
| run: | | |
| bun install -g surge | |
| surge playground/dist pr-ui-preview-${{ github.event.pull_request.number }}.surge.sh --token ${{ env.SURGE_TOKEN }} | |
| - name: Comment PR | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const previewUrl = `https://pr-ui-preview-${context.issue.number}.surge.sh`; | |
| const body = `🚀 Preview deployment is ready!\n\nYou can view the preview at: ${previewUrl}`; | |
| const comments = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| }); | |
| const existingComment = comments.data.find(comment => | |
| comment.body.includes('Preview deployment is ready!') | |
| ); | |
| if (existingComment) { | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: existingComment.id, | |
| body: body | |
| }); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body: body | |
| }); | |
| } |