Skip to content

Commit

Permalink
make build step optional in spin deploy (#35)
Browse files Browse the repository at this point in the history
Signed-off-by: Rajat Jindal <[email protected]>
  • Loading branch information
rajatjindal authored May 2, 2023
1 parent d027f52 commit b7d2407
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@ jobs:

```




## Deploy Spin app to Fermyon Cloud - `fermyon/actions/spin/deploy@v1`

Build and deploy the Spin app to Fermyon Cloud.
Expand All @@ -152,6 +149,8 @@ Build and deploy the Spin app to Fermyon Cloud.
| fermyon_token | True | - | [Fermyon Cloud Personal Access Token](https://developer.fermyon.com/cloud/user-settings.md#create-and-manage-a-personal-access-token) for deploying the Spin app to Fermyon Cloud |
| manifest_file | False | spin.toml | Path to `spin.toml`. |
| key_values | False | - | 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. Refer to example below. |
| run_build | False | True | If enabled, run `spin build` |

### Example


Expand Down
5 changes: 4 additions & 1 deletion dist/spin/deploy/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions spin/deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ inputs:
key_values:
required: false
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'
run_build:
required: false
description: 'run `spin build` if enabled (default)'
default: true
runs:
using: 'node16'
main: '../../dist/spin/deploy/index.js'
5 changes: 4 additions & 1 deletion src/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import * as cloud from './cloud'

async function run(): Promise<void> {
try {
await actions.build()
const buildEnabled = core.getBooleanInput('run_build') === false ? false : true;
if (buildEnabled) {
await actions.build()
}

const token = core.getInput('fermyon_token', { required: true })
await cloud.login(token)
Expand Down

0 comments on commit b7d2407

Please sign in to comment.