diff --git a/.github/workflows/test-env-cleanup.yml b/.github/workflows/test-env-cleanup.yml index b61ca6ade..a0216056d 100644 --- a/.github/workflows/test-env-cleanup.yml +++ b/.github/workflows/test-env-cleanup.yml @@ -24,7 +24,7 @@ jobs: aws-region: ${{ secrets.AWS_DEFAULT_REGION }} - name: Remove S3 directory - run: aws s3 rm s3://${{ secrets.AWS_TEST_DEPLOYMENT_BUCKET }}/${{ env.domain }} + run: aws s3 rm --recursive s3://${{ secrets.AWS_TEST_DEPLOYMENT_BUCKET }}/${{ env.domain }}/ - name: Invalidate cache run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_TEST_CF_DIST_ID }} --paths "/${{ env.domain }}/*" diff --git a/.github/workflows/test-env-deploy.yml b/.github/workflows/test-env-deploy.yml index 540f064cb..34b74ffb1 100644 --- a/.github/workflows/test-env-deploy.yml +++ b/.github/workflows/test-env-deploy.yml @@ -41,17 +41,20 @@ jobs: run: | npm ci - - name: Set API URI - # Setting API_URI env variable from PR description + - name: Get custom API_URI + id: api_uri + # Search for API_URI in PR description env: pull_request_body: ${{ github.event.pull_request.body }} prefix: API_URI= pattern: (http|https)://[a-zA-Z0-9.]+/graphql/? run: | - echo "::set-env name=API_URI::$(echo $pull_request_body | grep -Eo "$prefix$pattern" | sed s/$prefix// | head -n 1)" + echo "::set-output name=custom_api_uri::$(echo $pull_request_body | grep -Eo "$prefix$pattern" | sed s/$prefix// | head -n 1)" - name: Run build env: + # Use custom API_URI or the default one + API_URI: ${{ steps.api_uri.outputs.custom_api_uri || 'https://master.staging.saleor.rocks/graphql/' }} APP_MOUNT_URI: / STATIC_URL: / run: |