Skip to content

Commit

Permalink
feat: update deployment best practices for DSR (#1621)
Browse files Browse the repository at this point in the history
* feat: update the pipeline sample when deploy DSR template

* feat: update new best practice to deploy dsr into AWS

* fix lint

* fix lint

* Update suggestion

Co-authored-by: Micha Hobert <[email protected]>

* Update suggestion

Co-authored-by: Micha Hobert <[email protected]>

* Update suggestion

Co-authored-by: Micha Hobert <[email protected]>

* Update suggestion

Co-authored-by: Micha Hobert <[email protected]>

* Update suggestion

Co-authored-by: Micha Hobert <[email protected]>

---------

Co-authored-by: Micha Hobert <[email protected]>
  • Loading branch information
quando1910 and Isengo1989 authored Dec 20, 2024
1 parent 5d5350f commit 754592e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 4 deletions.
35 changes: 35 additions & 0 deletions products/digital-sales-rooms/best-practices/app-deployment/aws.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
nav:
title: AWS
position: 10

---

# Deploy with AWS Amplify

In this chapter, you will learn how to deploy the frontend source code to [AWS Amplify](https://aws.amazon.com/amplify/).

## Prerequisites

* Register an AWS account.
* Clone the frontend source code and push it to your GitHub repository.
* Download the plugin zip. After extracting it, you will find it inside `/templates/dsr-frontends`.
* Push source code to your Git repository.

## Deploy

* Login to the AWS Amplify Hosting Console.
* Create a new app in AWS Amplify.
* Select and authorize access to your Git repository provider and select the main branch (it will auto deploy when there are some changes in the main branch).
* Choose a name for your app and make sure build settings are auto-detected.
* Set Environment variables under the Advanced Settings section.
* Add `SHOPWARE_STORE_API`, `SHOPWARE_ADMIN_API`, `SHOPWARE_STORE_API_ACCESS_TOKEN`, `SHOPWARE_STOREFRONT_URL`, `ORIGIN` variables with appropriate values.
* Confirm configuration and click on "Save and Deploy".

## Custom domain

After deploying your code to AWS Amplify, you may wish to point custom domains (or subdomains) to your site. AWS has an [instruction](https://docs.aws.amazon.com/amplify/latest/userguide/custom-domains.html).

## Configure sales channel domain

Your website is ready, and you should have a frontend app domain. Please use the current domain to configure [sales channel domain](../../configuration/domain-config.md).
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
nav:
title: Cloudflare
position: 10
position: 20

---

Expand Down Expand Up @@ -49,7 +49,7 @@ wrangler pages deploy dist/

* In GitHub Secrets, add `CLOUDFLARE_API_TOKEN` with API token value.
* [Create an API token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) in the Cloudflare dashboard with the "Cloudflare Pages — Edit" permission.
* In GitHub environment variables, create new environment named `production`. Add `SHOPWARE_ENDPOINT` and `SHOPWARE_ACCESS_TOKEN` variables with appropriate values.
* In GitHub environment variables, create new environment named `production`. Add `SHOPWARE_STORE_API`, `SHOPWARE_ADMIN_API`, `SHOPWARE_STORE_API_ACCESS_TOKEN`, `SHOPWARE_STOREFRONT_URL`, `ORIGIN` variables with appropriate values.
* Besides `production`, we can add new values for the same variable names in multiple environments such as `development`, `staging`.

### Setup pipeline
Expand Down Expand Up @@ -95,8 +95,12 @@ jobs:
- name: Build env file
run: |
touch .env
echo SHOPWARE_ENDPOINT=${{ vars.SHOPWARE_ENDPOINT }} >> .env
echo SHOPWARE_ACCESS_TOKEN=${{ vars.SHOPWARE_ACCESS_TOKEN }} >> .env
# echo ALLOW_ANONYMOUS_MERCURE=${{ vars.ALLOW_ANONYMOUS_MERCURE }} >> .env
echo SHOPWARE_STORE_API=${{ vars.SHOPWARE_STORE_API }} >> .env
echo SHOPWARE_ADMIN_API=${{ vars.SHOPWARE_ADMIN_API }} >> .env
echo SHOPWARE_STORE_API_ACCESS_TOKEN=${{ vars.SHOPWARE_STORE_API_ACCESS_TOKEN }} >> .env
echo SHOPWARE_STOREFRONT_URL=${{ vars.SHOPWARE_STOREFRONT_URL }} >> .env
echo ORIGIN=${{ vars.ORIGIN }} >> .env
cat .env
- name: Build code
Expand Down

0 comments on commit 754592e

Please sign in to comment.