@scrymore/scry-deployer 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/lib/init.js +4 -2
- package/lib/templates.js +4 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -406,7 +406,7 @@ If you're installing from GitHub, the workflow file is already included.
|
|
|
406
406
|
| `SCRY_API_URL` | Backend API endpoint for uploads | `https://api.scrymore.com` |
|
|
407
407
|
| `SCRY_VIEW_URL` | Base URL where users view deployed Storybooks | `https://view.scrymore.com` |
|
|
408
408
|
|
|
409
|
-
**Note:** The `SCRY_VIEW_URL` is where users will access your deployed Storybook (e.g., `https://view.scrymore.com/{project}/pr-{number}
|
|
409
|
+
**Note:** The `SCRY_VIEW_URL` is where users will access your deployed Storybook (e.g., `https://view.scrymore.com/{project}/pr-{number}/`). This is separate from `SCRY_API_URL`, which is the backend API endpoint used for uploads.
|
|
410
410
|
|
|
411
411
|
**Step 3: Configure GitHub Actions Secrets (Optional)**
|
|
412
412
|
|
|
@@ -444,14 +444,14 @@ If your build command is different, update line 29 in `.github/workflows/deploy-
|
|
|
444
444
|
|
|
445
445
|
The workflow constructs deployment URLs using the `SCRY_VIEW_URL` variable:
|
|
446
446
|
```
|
|
447
|
-
{SCRY_VIEW_URL}/{PROJECT_ID}/pr-{PR_NUMBER}
|
|
447
|
+
{SCRY_VIEW_URL}/{PROJECT_ID}/pr-{PR_NUMBER}/
|
|
448
448
|
```
|
|
449
449
|
|
|
450
450
|
**Default:** If `SCRY_VIEW_URL` is not set, it defaults to `https://view.scrymore.com`
|
|
451
451
|
|
|
452
452
|
**Example URLs:**
|
|
453
|
-
- With default: `https://view.scrymore.com/my-project/pr-123
|
|
454
|
-
- With custom domain: `https://storybooks.mycompany.com/my-project/pr-123
|
|
453
|
+
- With default: `https://view.scrymore.com/my-project/pr-123/`
|
|
454
|
+
- With custom domain: `https://storybooks.mycompany.com/my-project/pr-123/`
|
|
455
455
|
|
|
456
456
|
To use a custom domain, add `SCRY_VIEW_URL` as a repository variable (see Step 2).
|
|
457
457
|
|
|
@@ -515,7 +515,7 @@ The CLI also supports these environment variables for backward compatibility:
|
|
|
515
515
|
```markdown
|
|
516
516
|
## 🚀 Storybook Preview Deployed
|
|
517
517
|
|
|
518
|
-
**Preview URL:** https://view.scrymore.com/my-project/pr-123
|
|
518
|
+
**Preview URL:** https://view.scrymore.com/my-project/pr-123/
|
|
519
519
|
|
|
520
520
|
📌 **Details:**
|
|
521
521
|
- **Commit:** `abc1234`
|
package/lib/init.js
CHANGED
|
@@ -351,6 +351,7 @@ If you haven't already, set up these repository variables:
|
|
|
351
351
|
3. Add these Variables (Variables tab):
|
|
352
352
|
• SCRY_PROJECT_ID = ${projectId}
|
|
353
353
|
• SCRY_API_URL = ${apiUrl}
|
|
354
|
+
• SCRY_VIEW_URL = https://view.scrymore.com (optional, defaults to this)
|
|
354
355
|
|
|
355
356
|
4. Add this Secret (Secrets tab):
|
|
356
357
|
• SCRY_API_KEY = ${apiKey}
|
|
@@ -358,6 +359,7 @@ If you haven't already, set up these repository variables:
|
|
|
358
359
|
Or install GitHub CLI and run:
|
|
359
360
|
gh variable set SCRY_PROJECT_ID --body "${projectId}"
|
|
360
361
|
gh variable set SCRY_API_URL --body "${apiUrl}"
|
|
362
|
+
gh variable set SCRY_VIEW_URL --body "https://view.scrymore.com"
|
|
361
363
|
gh secret set SCRY_API_KEY --body "${apiKey}"
|
|
362
364
|
`);
|
|
363
365
|
}
|
|
@@ -465,8 +467,8 @@ ${!pushed ? `
|
|
|
465
467
|
• Every pull request (as a preview)
|
|
466
468
|
|
|
467
469
|
🌐 Deployment URLs:
|
|
468
|
-
• Production:
|
|
469
|
-
• PR Previews:
|
|
470
|
+
• Production: https://view.scrymore.com/${projectId}/latest/
|
|
471
|
+
• PR Previews: https://view.scrymore.com/${projectId}/pr-{number}/
|
|
470
472
|
|
|
471
473
|
📖 Learn more: https://github.com/epinnock/scry-node
|
|
472
474
|
💬 Need help? Open an issue on GitHub
|
package/lib/templates.js
CHANGED
|
@@ -153,10 +153,11 @@ ${cache}
|
|
|
153
153
|
--dir ./storybook-static \\
|
|
154
154
|
--version pr-\${{ github.event.pull_request.number }}
|
|
155
155
|
|
|
156
|
-
# Construct deployment URL
|
|
156
|
+
# Construct deployment URL using VIEW_URL (where users access the deployed Storybook)
|
|
157
|
+
# Defaults to https://view.scrymore.com if SCRY_VIEW_URL is not set
|
|
157
158
|
PROJECT_ID="\${{ vars.SCRY_PROJECT_ID }}"
|
|
158
|
-
|
|
159
|
-
DEPLOY_URL="\${
|
|
159
|
+
VIEW_URL="\${{ vars.SCRY_VIEW_URL || 'https://view.scrymore.com' }}"
|
|
160
|
+
DEPLOY_URL="\${VIEW_URL}/\${PROJECT_ID}/pr-\${{ github.event.pull_request.number }}/"
|
|
160
161
|
echo "deployment_url=\$DEPLOY_URL" >> $GITHUB_OUTPUT
|
|
161
162
|
env:
|
|
162
163
|
STORYBOOK_DEPLOYER_API_URL: \${{ vars.SCRY_API_URL }}
|