|
3 | 3 | VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} |
4 | 4 | VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} |
5 | 5 | on: |
| 6 | + workflow_dispatch: |
| 7 | + inputs: |
| 8 | + pr_number: |
| 9 | + description: "Pull Request Number" |
| 10 | + required: true |
| 11 | + type: string |
6 | 12 | push: |
7 | 13 | branches: |
8 | 14 | - main |
@@ -31,12 +37,12 @@ jobs: |
31 | 37 | - uses: pnpm/action-setup@v4 |
32 | 38 | name: Install pnpm |
33 | 39 | with: |
34 | | - version: 9.12.3 |
| 40 | + version: 10.15.0 |
35 | 41 | run_install: false |
36 | 42 | - name: Install Node.js |
37 | 43 | uses: actions/setup-node@v3 |
38 | 44 | with: |
39 | | - node-version: 20 |
| 45 | + node-version: 22 |
40 | 46 | cache: "pnpm" |
41 | 47 | - name: Install node_modules |
42 | 48 | run: pnpm install |
@@ -70,27 +76,27 @@ jobs: |
70 | 76 |
|
71 | 77 | # Preview deployment (for pull requests and non-main pushes) |
72 | 78 | - name: Pull Vercel environment information (Preview) |
73 | | - if: github.event_name == 'pull_request_target' || (github.event_name == 'push' && github.ref != 'refs/heads/main') |
| 79 | + if: github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref != 'refs/heads/main') |
74 | 80 | run: vercel pull --yes --environment=preview --token ${{ secrets.VERCEL_TOKEN }} |
75 | 81 | - name: Build project artifacts (Preview) |
76 | | - if: github.event_name == 'pull_request_target' || (github.event_name == 'push' && github.ref != 'refs/heads/main') |
| 82 | + if: github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref != 'refs/heads/main') |
77 | 83 | run: vercel build --token ${{ secrets.VERCEL_TOKEN }} |
78 | 84 | - name: Deploy to Vercel (Preview) |
79 | 85 | id: deploy-preview |
80 | | - if: github.event_name == 'pull_request_target' || (github.event_name == 'push' && github.ref != 'refs/heads/main') |
| 86 | + if: github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref != 'refs/heads/main') |
81 | 87 | run: | |
82 | 88 | DEPLOYMENT_URL=$(vercel deploy --prebuilt --token ${{ secrets.VERCEL_TOKEN }}) |
83 | 89 | echo "deployment_url=$DEPLOYMENT_URL" >> $GITHUB_OUTPUT |
84 | 90 | - name: Find Documentation Comment |
85 | 91 | uses: peter-evans/find-comment@v3 |
86 | 92 | id: find-comment |
87 | | - if: github.event_name == 'pull_request_target' |
| 93 | + if: github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch' |
88 | 94 | with: |
89 | 95 | issue-number: ${{ github.event.number }} |
90 | 96 | comment-author: "github-actions[bot]" |
91 | 97 | body-includes: "🧪 Example App Preview Deployed!" |
92 | 98 | - name: Create or Update Documentation Comment |
93 | | - if: github.event_name == 'pull_request_target' |
| 99 | + if: github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch' |
94 | 100 | uses: peter-evans/create-or-update-comment@v4 |
95 | 101 | with: |
96 | 102 | comment-id: ${{ steps.find-comment.outputs.comment-id }} |
|
0 commit comments