generated from itsjavi/template-react-component-library
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add deploy-storybook action
- Loading branch information
Showing
2 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: 'Deploy Storybook to GitHub Pages' | ||
description: 'Build and deploy storybook code to GitHub pages' | ||
branding: | ||
icon: upload-cloud | ||
color: red | ||
inputs: | ||
checkout: | ||
description: 'Specifies if this action should checkout the code' | ||
required: false | ||
default: 'true' | ||
path: | ||
description: 'Specifies the path of the static assets after building' | ||
required: false | ||
# TODO: where does storybook output by default? | ||
default: 'dist/storybook' | ||
install_command: | ||
description: 'Specifies the command to run the installation.' | ||
required: false | ||
default: 'npm ci' | ||
build_command: | ||
description: 'Specifies the command to run after npm ci for the build' | ||
required: false | ||
default: 'npm run build-storybook' | ||
outputs: | ||
page_url: | ||
description: "The URL of the page" | ||
value: ${{ steps.deploy.outputs.page_url }} | ||
|
||
runs: | ||
using: 'composite' | ||
|
||
steps: | ||
- name: Checkout if required | ||
if: ${{ inputs.checkout == 'true' }} | ||
uses: actions/checkout@v4 | ||
|
||
- name: 'Build' | ||
shell: bash | ||
run: | | ||
echo "::group::Build" | ||
${{ inputs.install_command }} | ||
${{ inputs.build_command }} | ||
echo "::endgroup::" | ||
- name: 'upload' | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ${{ inputs.path }} | ||
|
||
- id: deploy | ||
name: Deploy to GitHub Pages | ||
uses: actions/deploy-pages@v4 | ||
with: | ||
token: ${{ github.token }} | ||
|
||
# - name: Print footer | ||
# shell: bash | ||
# run: | | ||
# echo "" >> $GITHUB_STEP_SUMMARY | ||
# echo "# Made by [![Bitovi](https://www.bitovi.com/hubfs/limbo-generated/imgs/logos/bitovi-logo-23.svg)](https://bitovi.com)" >> $GITHUB_STEP_SUMMARY | ||
# echo "" >> $GITHUB_STEP_SUMMARY | ||
# echo "Check the rest of our actions in the [GitHub Marketplace](https://github.com/marketplace?category=&type=actions&verification=&query=bitovi)!" >> $GITHUB_STEP_SUMMARY | ||
# echo "" >> $GITHUB_STEP_SUMMARY | ||
# echo "You can get help or ask questions on our [Discord Channel](https://discord.gg/zAHn4JBVcX), or set up a free consultation on our [platform engineering website](https://www.bitovi.com/services/devops-consulting/platform-engineering)." >> $GITHUB_STEP_SUMMARY | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,7 +65,7 @@ jobs: | |
- name: "Build storybook" | ||
run: pnpm build:storybook | ||
|
||
- uses: bitovi/github-actions-storybook[email protected] | ||
- uses: ./.github/actions/deploy-storybook | ||
with: | ||
install_command: pnpm install # default: npm ci | ||
build_command: pnpm build:storybook # default: npm run build-storybook | ||
|