-
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.
- Loading branch information
jackson
authored and
jackson
committed
Jun 21, 2024
1 parent
7d5479b
commit cebc800
Showing
2 changed files
with
73 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,72 @@ | ||
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: 'storybook-static' | ||
install_yarn: | ||
description: 'Install yarn.' | ||
required: false | ||
default: 'npm install -g yarn' | ||
install_command: | ||
description: 'Specifies the command to run the installation.' | ||
required: false | ||
default: 'yarn install --immutable --immutable-cache --check-cache' | ||
build_command: | ||
description: 'Specifies the command to run after npm ci for the build' | ||
required: false | ||
default: 'yarn build-storybook' | ||
outputs: | ||
page_url: | ||
description: "The URL of the page" | ||
value: ${{ steps.deploy.outputs.page_url }} | ||
|
||
|
||
|
||
runs: | ||
using: 'ubuntu-latest' | ||
steps: | ||
- name: Checkout if required | ||
if: ${{ inputs.checkout == 'true' }} | ||
uses: actions/checkout@v4 | ||
|
||
- name: 'Build' | ||
shell: bash | ||
run: | | ||
echo "::group::Build" | ||
corepack enable | ||
${{ inputs.install_yarn }} | ||
${{ 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 |
---|---|---|
|
@@ -14,6 +14,6 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- id: build-publish | ||
uses: bitovi/github-actions[email protected] | ||
uses: actions/action | ||
with: | ||
path: build # change to your build folder |