-
Notifications
You must be signed in to change notification settings - Fork 7
fix #30 - feat: Add GitHub Action to publish Storybook preview for every PR via Netlify #58
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?
Changes from all commits
3e3c803
57041d8
249aeac
1958622
4f815e6
b0e3dfa
9bad0c2
8d610e9
448a609
204b11e
427ba77
87e6382
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||||||||||||
| # | ||||||||||||||||
| # Copyright 2021-Present The Serverless Workflow Specification Authors | ||||||||||||||||
| # | ||||||||||||||||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||||||||||||||||
| # you may not use this file except in compliance with the License. | ||||||||||||||||
| # You may obtain a copy of the License at | ||||||||||||||||
| # | ||||||||||||||||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||||||||||||||||
| # | ||||||||||||||||
| # Unless required by applicable law or agreed to in writing, software | ||||||||||||||||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||||||||||||||||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||||||||||||
| # See the License for the specific language governing permissions and | ||||||||||||||||
| # limitations under the License. | ||||||||||||||||
| # | ||||||||||||||||
|
|
||||||||||||||||
| [build.environment] | ||||||||||||||||
| NODE_VERSION = "24" | ||||||||||||||||
| PNPM_VERSION = "10.31.0" | ||||||||||||||||
| PREVIEW_PACKAGE_NAME = "@serverlessworkflow/diagram-editor" | ||||||||||||||||
|
|
||||||||||||||||
| [build] | ||||||||||||||||
| command = """ | ||||||||||||||||
| set -e | ||||||||||||||||
fantonangeli marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||
| pnpm -F "${PREVIEW_PACKAGE_NAME}..." build:dev | ||||||||||||||||
| pnpm -F "$PREVIEW_PACKAGE_NAME" build:storybook | ||||||||||||||||
| """ | ||||||||||||||||
| publish = "packages/serverless-workflow-diagram-editor/dist-storybook" | ||||||||||||||||
fantonangeli marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||
| ignore = """ | ||||||||||||||||
| set -e -o pipefail | ||||||||||||||||
| git fetch --no-tags --depth=1 origin main:refs/remotes/origin/main | ||||||||||||||||
| npm i -g "pnpm@$PNPM_VERSION" | ||||||||||||||||
fantonangeli marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||
| ! pnpm -F '...[origin/main]' -rc exec 'echo "$PNPM_PACKAGE_NAME"' | grep -Fqx "$PREVIEW_PACKAGE_NAME" | ||||||||||||||||
fantonangeli marked this conversation as resolved.
Show resolved
Hide resolved
Comment on lines
+31
to
+33
|
||||||||||||||||
| git fetch --no-tags --depth=1 origin main:refs/remotes/origin/main | |
| npm i -g "pnpm@$PNPM_VERSION" | |
| ! pnpm -F '...[origin/main]' -rc exec 'echo "$PNPM_PACKAGE_NAME"' | grep -Fqx "$PREVIEW_PACKAGE_NAME" | |
| BASE_REF="${GITHUB_BASE_REF:-$(git symbolic-ref --quiet --short refs/remotes/origin/HEAD | sed 's#^origin/##')}" | |
| git fetch --no-tags --depth=1 origin "$BASE_REF:refs/remotes/origin/$BASE_REF" | |
| npm i -g "pnpm@$PNPM_VERSION" | |
| ! pnpm -F "...[origin/$BASE_REF]" -rc exec 'echo "$PNPM_PACKAGE_NAME"' | grep -Fqx "$PREVIEW_PACKAGE_NAME" |
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.
I don't want to introduce too much logic, deriving the branch ref and risking to have bugs with:
BASE_REF="${GITHUB_BASE_REF:-$(git symbolic-ref --quiet --short refs/remotes/origin/HEAD | sed 's#^origin/##')}"
Uh oh!
There was an error while loading. Please reload this page.