From 6b8e137452a92fd55bf3944c65ee79c701817b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gostan=CC=81ski?= Date: Wed, 10 Jul 2024 11:30:17 +0200 Subject: [PATCH] feat: automatically set the NxXT_PUBLIC_ALOKAI_MIDDLEWARE_CDN_CACHE_BUSTING_ID --- build-frontend/action.yml | 1 - deploy/action.yml | 13 ++----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/build-frontend/action.yml b/build-frontend/action.yml index aa4b463..70cd781 100644 --- a/build-frontend/action.yml +++ b/build-frontend/action.yml @@ -98,4 +98,3 @@ runs: NPM_USER=${{ inputs.npm_user }} NPM_REGISTRY=${{ inputs.npm_registry }} NUXT_IMAGE_PROVIDER=${{ inputs.image_provider }} - GIT_SHA=${{ steps.resolve.outputs.version }} diff --git a/deploy/action.yml b/deploy/action.yml index dba0108..95b3843 100644 --- a/deploy/action.yml +++ b/deploy/action.yml @@ -37,22 +37,13 @@ runs: environment: production initial-status: in_progress - - name: Deploy Frontend App (${{ inputs.project_name }}.${{ inputs.cloud_region }}.gcp.storefrontcloud.io) + - name: Deploy (${{ inputs.project_name }}.${{ inputs.cloud_region }}.gcp.storefrontcloud.io) uses: fjogeleit/http-request-action@v1 with: url: "${{ inputs.console_api_url }}/cloud/instances/${{ inputs.project_name }}-${{ inputs.cloud_region }}-gcp-storefrontcloud-io/deploy" method: "PATCH" customHeaders: '{"Content-Type":"application/json"}' - data: '{ "cloudUserId":"${{ inputs.cloud_username }}", "cloudUserPassword":"${{ inputs.cloud_password }}", "dockerImageHash":"${{ inputs.version || github.sha }}" }' - timeout: 60000 - - - name: Deploy Middleware (${{ inputs.project_name }}.${{ inputs.cloud_region }}.gcp.storefrontcloud.io) - uses: fjogeleit/http-request-action@v1 - with: - url: "${{ inputs.console_api_url }}/cloud/instances/${{ inputs.project_name }}-${{ inputs.cloud_region }}-gcp-storefrontcloud-io/deploy" - method: "PATCH" - customHeaders: '{"Content-Type":"application/json"}' - data: '{ "middleware":true, "cloudUserId":"${{ inputs.cloud_username }}", "cloudUserPassword":"${{ inputs.cloud_password }}", "dockerImageHash":"${{ inputs.version || github.sha }}", "middlewareData":{ "path":"/api/", "port":4000, "has_base_path":false } }' + data: '{ "middleware":true, "cloudUserId":"${{ inputs.cloud_username }}", "cloudUserPassword":"${{ inputs.cloud_password }}", "dockerImageHash":"${{ inputs.version || github.sha }}", "env_var": { "NUXT_PUBLIC_ALOKAI_MIDDLEWARE_CDN_CACHE_BUSTING_ID":"${{ inputs.version || github.sha }}", "NEXT_PUBLIC_ALOKAI_MIDDLEWARE_CDN_CACHE_BUSTING_ID":"${{ inputs.version || github.sha }}" }, "middlewareData":{ "path":"/api/", "port":4000, "has_base_path":false } }' timeout: 60000 - name: Update deployment status (success)