Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ concurrency:

permissions:
contents: read
deployments: write

jobs:
check:
Expand All @@ -35,6 +36,9 @@ jobs:
storybook:
needs: check
runs-on: ubuntu-latest
environment:
name: production
url: ${{ steps.deploy.outputs.url }}
env:
VERCEL_ORG_ID: team_YrVcbYkLqoCTzSAZ7j4pJHNC
VERCEL_PROJECT_ID: prj_FH1ivQlxf7TAW2eVBlstRO5UiXgj
Expand All @@ -44,11 +48,17 @@ jobs:
- name: Install Vercel CLI
run: npm install --global vercel@59.23.2
- name: Deploy Storybook
run: vercel deploy --prod --yes --token="$VERCEL_TOKEN"
id: deploy
run: |
url=$(vercel deploy --prod --yes --token="$VERCEL_TOKEN")
echo "url=$url" >> "$GITHUB_OUTPUT"

app:
needs: storybook
runs-on: ubuntu-latest
environment:
name: production
url: ${{ steps.deploy.outputs.url }}
env:
VERCEL_ORG_ID: team_YrVcbYkLqoCTzSAZ7j4pJHNC
VERCEL_PROJECT_ID: prj_AOUtpu53eTTvAKgfxm2QafOpyJQ9
Expand All @@ -58,4 +68,7 @@ jobs:
- name: Install Vercel CLI
run: npm install --global vercel@59.23.2
- name: Deploy app
run: vercel deploy --prod --yes --token="$VERCEL_TOKEN"
id: deploy
run: |
url=$(vercel deploy --prod --yes --token="$VERCEL_TOKEN")
echo "url=$url" >> "$GITHUB_OUTPUT"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The Next.js app and Storybook are separate Vercel projects. In the app project,

## Releases

PRs run CI and receive Vercel previews. Merges to `main` do not deploy either production project. To release several merged PRs together, tag the chosen `main` commit with a `v.*` tag (for example, `v.0.0.1`) and push the tag. The release workflow checks that commit, deploys Storybook, waits for it to succeed, then deploys the app. A failed check or Storybook deployment leaves the app's current production deployment in place.
PRs run CI but do not create Vercel deployments. Git pushes do not deploy either project. To release several merged PRs together, tag the chosen `main` commit with a `v.*` tag (for example, `v.0.0.1`) and push the tag. The release workflow checks that commit, deploys Storybook, waits for it to succeed, then deploys the app. Both deployments appear in GitHub's `production` environment with their Vercel URLs. A failed check or Storybook deployment leaves the app's current production deployment in place.

The workflow uses the GitHub Actions secret `VERCEL_TOKEN`, with access to both Vercel projects. Rotate it before it expires.

Expand Down
4 changes: 1 addition & 3 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"git": {
"deploymentEnabled": {
"main": false
}
"deploymentEnabled": false
}
}
Loading