Skip to content

Commit 77694ca

Browse files
committed
Merge branch 'master' into 20250613_AI_ensure_poweres_of_two
2 parents f00b0aa + 2549299 commit 77694ca

File tree

2 files changed

+53
-9
lines changed

2 files changed

+53
-9
lines changed

.coderabbit.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
2+
language: "en-US"
3+
early_access: false
4+
reviews:
5+
profile: "chill"
6+
request_changes_workflow: true
7+
high_level_summary: true
8+
poem: false
9+
review_status: true
10+
collapse_walkthrough: false
11+
auto_review:
12+
enabled: true
13+
drafts: false
14+
chat:
15+
auto_reply: true
Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
name: 'Preview Deployment'
22
on:
33
pull_request_target:
4+
types: [opened, synchronize, reopened]
45
branches:
56
- master
67

78
jobs:
8-
deploy:
9-
permissions:
10-
actions: read
11-
contents: read
12-
deployments: write
13-
pull-requests: write
9+
# Job 1: Build the code (no secrets here)
10+
build:
1411
runs-on: ubuntu-latest
15-
timeout-minutes: 5
1612
steps:
1713
- name: Checkout code
1814
uses: actions/checkout@v4
15+
with:
16+
ref: ${{ github.event.pull_request.head.sha }}
17+
persist-credentials: false # Don't persist GitHub token
1918

2019
- name: Cache node_modules
2120
uses: actions/cache@v4
@@ -32,19 +31,49 @@ jobs:
3231
- run: yarn install
3332
- run: yarn build
3433

34+
- name: Upload build artifact
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: dist-files
38+
path: dist
39+
40+
# Job 2: Deploy with secrets (no PR code checkout)
41+
deploy:
42+
needs: build # Wait for build job to complete
43+
permissions:
44+
actions: read
45+
contents: read
46+
deployments: write
47+
issues: write
48+
pull-requests: write
49+
runs-on: ubuntu-latest
50+
timeout-minutes: 5
51+
steps:
52+
- name: Download build artifact
53+
uses: actions/download-artifact@v4
54+
with:
55+
name: dist-files
56+
path: dist
57+
58+
- name: Set short git commit SHA
59+
id: vars
60+
run: |
61+
calculatedSha=$(echo ${{ github.event.pull_request.head.sha }} | head -c 8)
62+
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
63+
3564
- name: Deploy to Cloudflare
3665
id: deploy
3766
uses: cloudflare/wrangler-action@v3
3867
with:
3968
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
4069
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
41-
command: pages deploy dist --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }} --branch ${{ github.head_ref }} --commit-dirty=true
70+
command: pages deploy dist --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }} --branch=${{ env.COMMIT_SHORT_SHA }} --commit-dirty=true
4271

4372
- name: Add deployment comment
4473
uses: thollander/actions-comment-pull-request@v3
4574
with:
4675
message: |
47-
Preview URL: ${{ steps.deploy.outputs.deployment-url }}
76+
Preview URL: ${{ steps.deploy.outputs.pages-deployment-alias-url }}
4877
reactions: eyes, rocket
4978
comment-tag: 'Preview URL'
5079
mode: recreate

0 commit comments

Comments
 (0)