Skip to content

Commit

Permalink
support passing key/values when deploying (#27)
Browse files Browse the repository at this point in the history
Signed-off-by: Rajat Jindal <[email protected]>
  • Loading branch information
rajatjindal authored Apr 26, 2023
1 parent 7fd435a commit 571bb0a
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 41 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/e2e-spin-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ jobs:
with:
fermyon_token: ${{ secrets.FERMYON_CLOUD_TOKEN }}
manifest_file: example-app/spin.toml
key_values: |-
abc=xyz
foo=bar
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ 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. |
### Example


Expand Down Expand Up @@ -179,6 +179,9 @@ jobs:
with:
manifest_file: example-app/spin.toml
fermyon_token: ${{ secrets.FERMYON_CLOUD_TOKEN }}
key_values: |-
abc=xyz
foo=bar
```
## Deploy preview of Spin app to Fermyon Cloud - `fermyon/actions/spin/preview@v1`
Expand All @@ -193,12 +196,13 @@ If you don't run the preview action with undeploy on the closed event, your prev

### Inputs

| Name | Required | Default | Description |
| ------------- | -------- | --------- | ------------------------------------------------------------------------------- |
| fermyon_token | True | - | Fermyon Cloud Personal Access Token for deploying the Spin app to Fermyon Cloud |
| manifest_file | False | spin.toml | Path to `spin.toml`. |
| github_token | True | - | The GitHub token for adding a comment on PR with preview URL. |
| undeploy | False | - | If true, removes the preview deployment from Fermyon Cloud |
| Name | Required | Default | Description |
| ------------- | -------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| fermyon_token | True | - | Fermyon Cloud Personal Access Token for deploying the Spin app to Fermyon Cloud |
| manifest_file | False | spin.toml | Path to `spin.toml`. |
| github_token | True | - | The GitHub token for adding a comment on PR with preview URL. |
| undeploy | False | - | If true, removes the preview deployment from Fermyon Cloud |
| 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. |

### Example

Expand Down Expand Up @@ -230,4 +234,7 @@ jobs:
fermyon_token: ${{ secrets.FERMYON_CLOUD_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
undeploy: ${{ github.event.pull_request && github.event.action == 'closed' }}
key_values: |-
abc=xyz
foo=bar
```
29 changes: 22 additions & 7 deletions dist/spin/deploy/index.js

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

29 changes: 22 additions & 7 deletions dist/spin/preview/index.js

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

29 changes: 22 additions & 7 deletions dist/spin/push/index.js

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

29 changes: 22 additions & 7 deletions dist/spin/setup/index.js

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

3 changes: 3 additions & 0 deletions spin/deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ inputs:
fermyon_token:
required: false
description: 'personal access token for Fermyon Cloud'
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'
runs:
using: 'node16'
main: '../../dist/spin/deploy/index.js'
3 changes: 3 additions & 0 deletions spin/preview/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ inputs:
undeploy:
required: false
description: 'if true, remove the preview deployment from Fermyon Cloud'
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'
runs:
using: 'node16'
main: '../../dist/spin/preview/index.js'
Loading

0 comments on commit 571bb0a

Please sign in to comment.