Skip to content

Commit b0df365

Browse files
authored
feat: define middleware port and path (#27)
* feat: add extra params for deploy action * docs: update README.md
1 parent b48b7f3 commit b0df365

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ With those four you can easily compose the deployment script for your needs.
1515
### build-frontend
1616

1717
```yaml
18-
uses: vuestorefront/storefront-deployment/build-frontend@v1
18+
uses: vuestorefront/storefront-deployment/build-frontend@v4.4.0
1919
with:
2020
project_name: ${{ secrets.PROJECT_NAME }}
2121
cloud_username: ${{ secrets.CLOUD_USERNAME }}
@@ -49,7 +49,7 @@ Any environment variables needed by an application is needed to be set in the Al
4949
### build-middleware
5050

5151
```yaml
52-
uses: vuestorefront/storefront-deployment/build-middleware@v1
52+
uses: vuestorefront/storefront-deployment/build-middleware@v4.4.0
5353
with:
5454
project_name: ${{ secrets.PROJECT_NAME }}
5555
cloud_username: ${{ secrets.CLOUD_USERNAME }}
@@ -77,7 +77,7 @@ with:
7777
### build-stripe-ct
7878

7979
```yaml
80-
uses: vuestorefront/storefront-deployment/build-stripe-ct
80+
uses: vuestorefront/storefront-deployment/build-stripe-ct@v4.4.0
8181
with:
8282
project_name: ${{ secrets.PROJECT_NAME }}
8383
cloud_username: ${{ secrets.CLOUD_USERNAME }}
@@ -107,7 +107,7 @@ with:
107107
### deploy
108108

109109
```yaml
110-
uses: vuestorefront/storefront-deployment/deploy@v1
110+
uses: vuestorefront/storefront-deployment/deploy@v4.4.0
111111
with:
112112
project_name: ${{ secrets.PROJECT_NAME }}
113113
cloud_username: ${{ secrets.CLOUD_USERNAME }}
@@ -126,12 +126,14 @@ with:
126126
- `cloud_region`: Region where the environment is set up in the Console. Required field.
127127
- `docker_registry_url`: URL to the Docker image registry. Optional field. Defaults to `registry.vuestorefront.cloud`.
128128
- `console_api_url`: URL to the Console. Optional field. Defaults to `https://api.platform.vuestorefront.io`.
129-
- `version`: Docker image tag that will be deployed. Example: 2.3.0, 3.1.0-rc.1. If not passed, github.sha will be used
129+
- `version`: Docker image tag that will be deployed. Example: 2.3.0, 3.1.0-rc.1. If not passed, `github.sha` will be used
130+
- `middleware_path`: Path in URL of the Storefront on which Middleware app will be available. If not passed, `/api/` will be used
131+
- `middleware_port`: Port on which Middleware application is working on. If not passed, `4000` will be used
130132

131133
### deploy/stripe-ct
132134

133135
```yaml
134-
uses: vuestorefront/storefront-deployment/deploy/stripe-ct
136+
uses: vuestorefront/storefront-deployment/deploy/stripe-ct@v4.4.0
135137
with:
136138
project_name: ${{ secrets.PROJECT_NAME }}
137139
cloud_username: ${{ secrets.CLOUD_USERNAME }}
@@ -154,4 +156,4 @@ with:
154156
- `extension_module_name`: Extension module name. It’s used as the name of the docker image and path where the api is available. Default value is `ct-stripe-extension`.
155157
- `extension_module_port`: Port of the extension module. Default value is `8080`.
156158
- `notification_module_name`: Notification module name. It’s used as the name of the docker image and path where the api is available. Default value is `ct-stripe-notification`.
157-
- `notification_module_port`: Port of the notification module. Default value is `8081`.
159+
- `notification_module_port`: Port of the notification module. Default value is `8081`.

deploy/action.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ inputs:
2424
version:
2525
description: "Version of the app"
2626
required: false
27+
middleware_path:
28+
description: 'Path to the Middleware app on the Reverse Proxy'
29+
required: false
30+
default: '/api/'
31+
middleware_port:
32+
description: 'Port of the Middleware app'
33+
required: false
34+
default: 4000
2735

2836
runs:
2937
using: "composite"
@@ -43,7 +51,7 @@ runs:
4351
url: "${{ inputs.console_api_url }}/cloud/instances/${{ inputs.project_name }}-${{ inputs.cloud_region }}-gcp-storefrontcloud-io/deploy"
4452
method: "PATCH"
4553
customHeaders: '{"Content-Type":"application/json"}'
46-
data: '{"middleware":true,"cloudUserId":"${{ inputs.cloud_username }}","cloudUserPassword":"${{ inputs.cloud_password }}","dockerImageHash":"${{ inputs.version || github.sha }}","env_var":{"03731de5-5ff9-49d9-a6e5-8af9c4fa75d9":{"name":"NUXT_PUBLIC_ALOKAI_MIDDLEWARE_CDN_CACHE_BUSTING_ID","value":"${{ inputs.version || github.sha }}","is_secret":false},"03731de5-5ff9-49d9-a6e5-8af9c4fa75":{"name":"NEXT_PUBLIC_ALOKAI_MIDDLEWARE_CDN_CACHE_BUSTING_ID","value":"${{ inputs.version || github.sha }}","is_secret":false}},"middlewareData":{"path":"/api/","port":4000,"has_base_path":false}}'
54+
data: '{"middleware":true,"cloudUserId":"${{ inputs.cloud_username }}","cloudUserPassword":"${{ inputs.cloud_password }}","dockerImageHash":"${{ inputs.version || github.sha }}","env_var":{"03731de5-5ff9-49d9-a6e5-8af9c4fa75d9":{"name":"NUXT_PUBLIC_ALOKAI_MIDDLEWARE_CDN_CACHE_BUSTING_ID","value":"${{ inputs.version || github.sha }}","is_secret":false},"03731de5-5ff9-49d9-a6e5-8af9c4fa75":{"name":"NEXT_PUBLIC_ALOKAI_MIDDLEWARE_CDN_CACHE_BUSTING_ID","value":"${{ inputs.version || github.sha }}","is_secret":false}},"middlewareData":{"path":"${{ inputs.middleware_path }}","port":${{ inputs.middleware_port }},"has_base_path":false}}'
4755
timeout: 60000
4856

4957
- name: Update deployment status (success)

0 commit comments

Comments
 (0)