feat: parepare rendering pages in edge runtime #34
Workflow file for this run
This file contains 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: Preview | |
on: | |
- pull_request | |
permissions: | |
issues: write | |
pull-requests: write | |
jobs: | |
prebuild: | |
name: Prebuild | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 21 | |
- name: Install dependencies | |
run: npm ci | |
- name: Run vercel build | |
uses: ./.github/actions/vercel-prebuild | |
with: | |
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} | |
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} | |
vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
branch: ${{ github.ref_name }} | |
build-command: npx next build | |
deploy: | |
name: Deploy | |
needs: | |
- prebuild | |
runs-on: ubuntu-latest | |
environment: | |
name: Latest Preview | |
url: ${{ steps.deployment.outputs.url }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 21 | |
- name: Install dependencies | |
run: npm ci | |
- name: Run vercel deploy | |
id: deployment | |
uses: ./.github/actions/vercel-deploy | |
with: | |
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} | |
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} | |
vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
- name: Find the previous comment | |
uses: peter-evans/find-comment@v3 | |
id: previous-comment | |
with: | |
issue-number: ${{ github.event.number }} | |
comment-author: "github-actions[bot]" | |
body-includes: "<!-- deployment #${{ github.event.number }} -->" | |
direction: last | |
- name: Create/update comments | |
uses: peter-evans/create-or-update-comment@v4 | |
with: | |
issue-number: ${{ github.event.number }} | |
comment-id: ${{ steps.previous-comment.outputs.comment-id }} | |
edit-mode: replace | |
body: | | |
<!-- deployment #${{ github.event.number }} --> | |
π Deployed a preview for `${{ github.sha }}`: | |
${{ steps.deployment.outputs.url }} |