Skip to content

Commit 2d038cf

Browse files
committed
f
1 parent 8a203ee commit 2d038cf

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/workflows/deploy.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,26 @@ jobs:
1515
if: github.event_name == 'pull_request'
1616
runs-on: ubuntu-latest
1717
environment: Preview
18+
env:
19+
CONVEX_PREVIEW_NAME: pr-${{ github.event.pull_request.number }}-deploy
1820
steps:
1921
- uses: actions/checkout@v6
2022
- name: Setup
2123
uses: ./.github/actions/setup
2224
- name: Deploy Convex Preview
2325
id: convex
2426
run: |
25-
PREVIEW_NAME="pr-${{ github.event.pull_request.number }}"
26-
npx convex deploy --preview-create "$PREVIEW_NAME" \
27+
npx convex deploy --preview-create "$CONVEX_PREVIEW_NAME" \
2728
--cmd 'echo "PREVIEW_URL=$CONVEX_URL" >> "$GITHUB_OUTPUT"' \
2829
--cmd-url-env-var-name CONVEX_URL
2930
env:
3031
CONVEX_DEPLOY_KEY: ${{ secrets.CONVEX_DEPLOY_KEY }}
32+
- name: Seed Database
33+
run: |
34+
npx convex import --replace-all convex-seeds/seeds/db.zip --yes \
35+
--preview-name "${{ env.CONVEX_PREVIEW_NAME }}"
36+
env:
37+
CONVEX_DEPLOY_KEY: ${{ secrets.CONVEX_DEPLOY_KEY }}
3138
- name: Build
3239
run: pnpm build
3340
env:

.github/workflows/playwright.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
environment: Preview
1616
env:
1717
REPORT_DIR: yps-crispy-carnival
18+
CONVEX_PREVIEW_NAME: pr-${{ github.event.pull_request.number }}-e2e
1819
steps:
1920
- uses: actions/checkout@v6
2021
- name: Setup
@@ -24,24 +25,23 @@ jobs:
2425
- name: Deploy Preview
2526
id: preview
2627
run: |
27-
PREVIEW_NAME="pr-${{ github.event.pull_request.number }}"
28-
npx convex deploy --preview-create "$PREVIEW_NAME" \
28+
npx convex deploy --preview-create "$CONVEX_PREVIEW_NAME" \
2929
--cmd 'echo "PREVIEW_URL=$CONVEX_URL" >> "$GITHUB_OUTPUT"' \
3030
--cmd-url-env-var-name CONVEX_URL
3131
env:
3232
CONVEX_DEPLOY_KEY: ${{ secrets.CONVEX_DEPLOY_KEY }}
3333
- name: Seed Database
3434
run: |
3535
npx convex import --replace-all convex-seeds/seeds/db.zip --yes \
36-
--preview-name "pr-${{ github.event.pull_request.number }}"
36+
--preview-name "${{ env.CONVEX_PREVIEW_NAME }}"
3737
env:
3838
CONVEX_DEPLOY_KEY: ${{ secrets.CONVEX_DEPLOY_KEY }}
3939
- name: Run Playwright tests
4040
id: playwright
4141
run: pnpm e2e
4242
env:
4343
VITE_CONVEX_URL: ${{ steps.preview.outputs.PREVIEW_URL }}
44-
CONVEX_PREVIEW_NAME: pr-${{ github.event.pull_request.number }}
44+
CONVEX_PREVIEW_NAME: ${{ env.CONVEX_PREVIEW_NAME }}
4545
E2E_CLERK_USER: ${{ vars.E2E_CLERK_USER }}
4646
E2E_CLERK_PASSWORD: ${{ vars.E2E_CLERK_PASSWORD }}
4747
CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}

0 commit comments

Comments
 (0)