-
Notifications
You must be signed in to change notification settings - Fork 9
/
action.yaml
93 lines (80 loc) · 3.18 KB
/
action.yaml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: 'Deploy React to GitHub Pages'
description: 'Build and deploy react 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'
checkout-filter:
description: Partially clone against a given filter. Overrides checkout-sparse-checkout if set. maps to actions/checkout inputs.checkout-filter
required: false
checkout-sparse-checkout:
description: Do a sparse checkout on given patterns. Each pattern should be separated with new lines. maps to actions/checkout inputs.sparse-checkout
required: false
checkout-sparse-checkout-cone-mode:
description: Specifies whether to use cone-mode when doing a sparse checkout. maps to actions/checkout inputs.sparse-checkout-cone-mode
required: false
default: true
path:
description: 'Specifies the path of the static assets after building'
required: false
default: 'dist'
install_command:
description: 'Specifies the command to run the installation.'
required: false
default: 'npm ci'
build_command:
description: 'Specifies the command to run after the install command for the build'
required: false
default: 'npm run build'
caching:
description: 'Specifies if the action should cache npm dependencies.'
required: false
default: false
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
with:
filter: ${{ inputs.checkout-filter }}
sparse-checkout: ${{ inputs.checkout-sparse-checkout }}
sparse-checkout-cone-mode: ${{ inputs.checkout-sparse-checkout-cone-mode }}
- name: 'Setup caching if required'
if: ${{ inputs.caching == 'true' }}
uses: actions/setup-node@v4
with:
cache: npm
- 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