Skip to content

Commit

Permalink
Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jackson authored and jackson committed Jun 21, 2024
1 parent 7d5479b commit cebc800
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 1 deletion.
72 changes: 72 additions & 0 deletions .github/workflows/actions/action.yaml
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
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit cebc800

Please sign in to comment.