-
Notifications
You must be signed in to change notification settings - Fork 15
enable demo preview deployment #397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
View your CI Pipeline Execution ↗ for commit 74d6f6a
☁️ Nx Cloud last updated this comment at |
ba45e13 to
ddce5c5
Compare
79bf1d8 to
b7bb2a2
Compare
b7bb2a2 to
389c556
Compare
389c556 to
74d6f6a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if: github.event_name == 'pull_request' | ||
| needs: [build-and-test, edge-worker-e2e] | ||
| runs-on: ubuntu-latest | ||
| environment: ${{ github.event_name == 'pull_request' && 'preview' || 'production' }} | ||
| environment: preview | ||
| # environment: ${{ github.event_name == 'pull_request' && 'preview' || 'production' }} | ||
| env: | ||
| NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | ||
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guard demo deployment from forked PRs lacking secrets
This job now runs for every pull_request, but it immediately depends on repository secrets (NX_CLOUD_ACCESS_TOKEN, CLOUDFLARE_*, DEMO_PREVIEW_*). For PRs opened from forks those secrets are intentionally unavailable, so the workflow will fail before any tests run and block external contributors. Consider gating the job to only run when github.event.pull_request.head.repo.fork == false or similar, or switch to pull_request_target if safe.
Useful? React with 👍 / 👎.
| - name: Deploy demo preview | ||
| id: deploy-demo | ||
| env: | ||
| PREVIEW_NAME: pr-${{ github.event.pull_request.number }} | ||
| run: | | ||
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | ||
| pnpm nx affected -t deploy:preview --projects=demo --base="$NX_BASE" --head="$NX_HEAD" | ||
| else | ||
| pnpm nx affected -t deploy --projects=demo --base="$NX_BASE" --head="$NX_HEAD" | ||
| fi | ||
| run: pnpm nx affected -t deploy:preview --base=origin/main --head=HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restrict Nx deploy to the demo project only
The Deploy demo preview step now executes pnpm nx affected -t deploy:preview without the previous --projects=demo filter. When the PR touches any other project that also has a deploy:preview target (e.g. the website), Nx will attempt to deploy that project in this job as well, but the job only sets demo-specific environment variables. This can cause the step to fail due to missing secrets or deploy the wrong project. Keep the --projects=demo restriction to limit the job to the intended target.
Useful? React with 👍 / 👎.
🔍 Preview Deployment: Website✅ Deployment successful! 🔗 Preview URL: https://pr-397.pgflow.pages.dev 📝 Details:
_Last updated: _ |
🔍 Preview Deployment: Demo✅ Deployment successful! 🔗 Preview URL: https://pr-397-pgflow-demo.jumski.workers.dev 📝 Details:
_Last updated: _ |

No description provided.