forked from bitovi/github-actions-storybook-to-github-pages
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
67 lines (58 loc) · 2.17 KB
/
action.yaml
File metadata and controls
67 lines (58 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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 [](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