Skip to content

Commit 2986dfa

Browse files
committed
feat(spin/preview): add run_build option
Signed-off-by: Vaughn Dice <vaughn.dice@fermyon.com>
1 parent ae5ffc0 commit 2986dfa

4 files changed

Lines changed: 14 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ If you don't run the preview action with undeploy on the closed event, your prev
226226
| github_token | True | - | The GitHub token for adding a comment on PR with preview URL. |
227227
| undeploy | False | - | If true, removes the preview deployment from Fermyon Cloud |
228228
| key_values | False | - | Pass one or more key/value pairs to the default store for all components" |
229+
| run_build | False | True | If enabled, run `spin build` |
229230
| variables | False | - | Pass a variable (variable=value) to all components of the application. You can specify multiple variables by putting each variable/value pair on its own line. Refer to example below. |
230231

231232
### Outputs

dist/spin/preview/index.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spin/preview/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ inputs:
1818
key_values:
1919
required: false
2020
description: 'Pass a key/value (key=value) to all components of the application. You can specify multiple key_values by putting each key/value pair on its own line'
21+
run_build:
22+
required: false
23+
description: 'run `spin build` if enabled (default)'
24+
default: true
2125
variables:
2226
required: false
2327
description: 'Pass a variable (variable=value) to all components of the application. You can specify multiple variables by putting each variable/value pair on its own line'

src/preview.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ async function run(): Promise<void> {
1717

1818
const token = core.getInput('fermyon_token', {required: true})
1919
await cloud.login(token)
20-
await actions.build()
20+
const buildEnabled =
21+
core.getBooleanInput('run_build') === false ? false : true
22+
if (buildEnabled) {
23+
await actions.build()
24+
}
2125
const appUrl = await actions.deployPreview(prNumber)
2226
core.setOutput('app-url', appUrl)
2327
} catch (error) {

0 commit comments

Comments
 (0)