Post blit:disconnected message to parent frame #41
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 website | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "js/website/**" | |
| - "js/core/**" | |
| - "js/react/**" | |
| - "crates/browser/**" | |
| pull_request: | |
| paths: | |
| - "js/website/**" | |
| - "js/core/**" | |
| - "js/react/**" | |
| - "crates/browser/**" | |
| jobs: | |
| deploy: | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: DeterminateSystems/nix-installer-action@main | |
| - uses: DeterminateSystems/magic-nix-cache-action@main | |
| - name: Deploy to Vercel | |
| id: deploy | |
| run: | | |
| args=() | |
| if [ "${{ github.event_name }}" = "push" ] && [ "${{ github.ref }}" = "refs/heads/main" ]; then | |
| args+=(--prod) | |
| fi | |
| output=$(./bin/deploy-website "${args[@]}" 2>&1 | tee /dev/stderr) || exit $? | |
| url=$(echo "$output" | grep -o 'https://[^ ]*\.vercel\.app' | tail -1) | |
| echo "url=$url" >> "$GITHUB_OUTPUT" | |
| env: | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| - name: Comment preview URL on PR | |
| if: github.event_name == 'pull_request' && steps.deploy.outputs.url | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const body = `🔗 **Preview:** ${{ steps.deploy.outputs.url }}`; | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| }); | |
| const existing = comments.find(c => c.body.startsWith('🔗 **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({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body, | |
| }); | |
| } |