Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@W-17900760@ Deploy Demo Storefront with SLAS Private Client #2297

Open
wants to merge 48 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a46d145
WIP
vcua-mobify Mar 4, 2025
474b0a4
Use zzrf-001 stg
vcua-mobify Mar 4, 2025
f9fe4cd
Set output
vcua-mobify Mar 4, 2025
efd0610
test
vcua-mobify Mar 4, 2025
cb39e57
test
vcua-mobify Mar 4, 2025
f8208b8
test
vcua-mobify Mar 4, 2025
e496643
test
vcua-mobify Mar 4, 2025
97b1fa7
test
vcua-mobify Mar 4, 2025
d662a3f
test
vcua-mobify Mar 4, 2025
f0deacb
test
vcua-mobify Mar 4, 2025
d4f9b80
test
vcua-mobify Mar 5, 2025
4d7b89d
test
vcua-mobify Mar 5, 2025
1c63829
test
vcua-mobify Mar 5, 2025
ccd15e6
test
vcua-mobify Mar 5, 2025
3cac50c
test
vcua-mobify Mar 5, 2025
4edc95f
Add logging
vcua-mobify Mar 5, 2025
70963d7
fix conditional
vcua-mobify Mar 5, 2025
fac54ed
Add brackets
vcua-mobify Mar 5, 2025
7d69a87
fix
vcua-mobify Mar 5, 2025
ee90db9
fix
vcua-mobify Mar 5, 2025
6c85fe2
adjust
vcua-mobify Mar 5, 2025
70556ec
test
vcua-mobify Mar 5, 2025
1add78b
test
vcua-mobify Mar 5, 2025
17b4440
test
vcua-mobify Mar 5, 2025
424d1cb
flip condition for testing
vcua-mobify Mar 5, 2025
137cc6f
Update handlebars for RefArchGlobal locales
vcua-mobify Mar 5, 2025
c0725e9
Add US locale + currency to RefArchGlobal and set as default
vcua-mobify Mar 5, 2025
3c60cb7
Add site alias
vcua-mobify Mar 5, 2025
5048c02
Enable passwordless and social login
vcua-mobify Mar 5, 2025
264ff06
Adjust comment since handlebars don't add a newline
vcua-mobify Mar 5, 2025
472d336
Apply aliases
vcua-mobify Mar 5, 2025
19b87e0
Adjust newline
vcua-mobify Mar 5, 2025
57593e9
Comment
vcua-mobify Mar 5, 2025
1ae59cb
Add siteid and locale to demo path
vcua-mobify Mar 5, 2025
3535578
Enable site setting
vcua-mobify Mar 5, 2025
2fb735a
Re-add handlebar helper
vcua-mobify Mar 5, 2025
7252dfe
showDefaults: true
vcua-mobify Mar 6, 2025
af69be8
Use translatable title for demo store
vcua-mobify Mar 6, 2025
8ad09cf
Fix lint
vcua-mobify Mar 6, 2025
e71baf0
Deploy to production demo site
vcua-mobify Mar 7, 2025
e7da5be
Re-enable bug bounty deploy
vcua-mobify Mar 7, 2025
6ec6c7b
Use Salesforce Cloud as default logo for extensible projects
vcua-mobify Mar 7, 2025
e5358bf
Change condition so we run a deploy
vcua-mobify Mar 7, 2025
5920ebb
Restore latest release condition
vcua-mobify Mar 7, 2025
45a66b1
Revert "Use Salesforce Cloud as default logo for extensible projects"
vcua-mobify Mar 10, 2025
bd51f1a
Use a non-extensible template for demo site
vcua-mobify Mar 10, 2025
5ec3954
Deploy demo site
vcua-mobify Mar 10, 2025
9afbfdc
Revert deployment condition
vcua-mobify Mar 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/actions/check_if_latest_release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ runs:
echo "Release event tag: $RELEASE_EVENT_TAG_NAME"

if [ "$LATEST_TAG_NAME" == "$RELEASE_EVENT_TAG_NAME" ]; then
echo "We are releasing the latest tag. Continuing deployment workflow."
exit 0
echo "We are releasing the latest tag."
echo "IS_LATEST_RELEASE=true" >> $GITHUB_ENV
else
echo "We are not releasing the latest tag. Stopping deployment workflow."
exit 1
echo "We are not releasing the latest tag."
echo "IS_LATEST_RELEASE=false" >> $GITHUB_ENV
fi
shell: bash
54 changes: 53 additions & 1 deletion .github/workflows/deploy_latest_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ on:
# For testing - to be removed
push:
branches:
- 'mrt-test-ci-deploy'
- 'deploy-demo-env-on-release'
# Run this workflow when a new Github release is published
release:
types: [released]

jobs:
check-latest-release:
runs-on: ubuntu-latest
outputs:
IS_LATEST_RELEASE: ${{ steps.checkRelease.outputs.IS_LATEST_RELEASE }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -19,10 +21,20 @@ jobs:
uses: ./.github/actions/check_if_latest_release
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Update Github Outputs
id: checkRelease
run: |-
IS_LATEST_RELEASE=$(echo ${{ env.IS_LATEST_RELEASE }})
echo "IS_LATEST_RELEASE=${{ env.IS_LATEST_RELEASE }}" >> "$GITHUB_OUTPUT"
if [ $IS_LATEST_RELEASE != "true" ]; then
echo "Deploy is not for the latest release. Stopping deployment"
fi

deploy-bug-bounty:
needs: check-latest-release
runs-on: ubuntu-latest
if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -58,3 +70,43 @@ jobs:
PROJECT: pwa-kit
MESSAGE: "tag ${{ github.event.release.tag_name }}"
FLAGS: --cloud-origin https://cloud-testing.mobify-staging.com -c ~/.mobify --wait

deploy-demo-site:
needs: check-latest-release
runs-on: ubuntu-latest
if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
id: setup_node
uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"

- name: Install Monorepo Dependencies
run: |-
# Install node dependencies
node ./scripts/gtime.js monorepo_install npm ci

- name: Generate Retail App Demo
uses: ./.github/actions/e2e_generate_app
with:
PROJECT_KEY: "retail-react-app-demo-site"

- name: Create MRT credentials file
uses: "./.github/actions/create_mrt"
with:
mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }}
mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }}

- name: Push Bundle to MRT (Demo Site)
uses: "./.github/actions/push_to_mrt"
with:
CWD: "../generated-projects/retail-react-app-demo-site"
TARGET: production
PROJECT: scaffold-pwa
MESSAGE: "tag ${{ github.event.release.tag_name }}"
FLAGS: --wait
8 changes: 1 addition & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,14 @@ jobs:
mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }}
mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }}

# TODO - Do we still need this?
- name: Push Bundle to MRT (Development)
if: env.IS_NOT_FORK == 'true' && env.IS_MRT_NODE == 'true' && env.DEVELOP == 'true'
uses: "./.github/actions/push_to_mrt"
with:
CWD: "./packages/template-retail-react-app"
TARGET: staging

- name: Push Bundle to MRT (Production)
if: env.IS_NOT_FORK == 'true' && env.IS_MRT_NODE == 'true' && env.RELEASE == 'true'
uses: "./.github/actions/push_to_mrt"
with:
CWD: "./packages/template-retail-react-app"
TARGET: production
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this since this is redundant. We are now deploying a preset to the demo site when a new latest release tag is produced.

This does mean that we won't be deploying preview releases onto the live demo site but I can create a different step to handle this if we want.


- name: Push Bundle to MRT (Commerce SDK React)
if: env.IS_NOT_FORK == 'true' && env.IS_MRT_NODE == 'true' && env.DEVELOP == 'true'
uses: "./.github/actions/push_to_mrt"
Expand Down
2 changes: 2 additions & 0 deletions e2e/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ module.exports = {
],
"retail-app-private-client": [],
"retail-react-app-bug-bounty": [],
"retail-react-app-demo-site": [],
},
PRESET: {
"retail-app-private-client": "retail-react-app-private-slas-client",
"retail-react-app-bug-bounty": "retail-react-app-bug-bounty",
"retail-react-app-demo-site": "retail-react-app-demo-private"
},
EXPECTED_GENERATED_ARTIFACTS: {
"retail-app-demo": [
Expand Down
3 changes: 2 additions & 1 deletion e2e/scripts/generate-project.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ program
'retail-app-ext',
'retail-app-no-ext',
'retail-app-private-client',
'retail-react-app-bug-bounty'
'retail-react-app-bug-bounty',
'retail-react-app-demo-site'
]
if (!validKeys.includes(value)) {
throw new Error('Invalid project key.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,32 @@ module.exports = {
app: {
// Customize how your 'site' and 'locale' are displayed in the url.
url: {
{{#if answers.project.demo.enableDemoSettings}}
// Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
// site: 'none',
site: 'path',
// Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
locale: 'none'
locale: 'path',
// This boolean value dictates whether or not default site or locale values are shown in the url. Defaults to: false
// showDefaults: true
showDefaults: true,
{{else}}
// Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
site: 'none',
// Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
locale: 'none',
// This boolean value dictates whether or not default site or locale values are shown in the url. Defaults to: false
showDefaults: false,
{{/if}}
// This boolean value dictates whether the plus sign (+) is interpreted as space for query param string. Defaults to: false
interpretPlusSignAsSpace: false
},
login: {
passwordless: {
// Enables or disables passwordless login for the site. Defaults to: false
{{#if answers.project.demo.enableDemoSettings}}
enabled: true,
{{else}}
enabled: false,
{{/if}}
// The callback URI, which can be an absolute URL (including third-party URIs) or a relative path set up by the developer.
// Required in 'callback' mode; if missing, passwordless login defaults to 'sms' mode, which requires Marketing Cloud configuration.
// If the env var `PASSWORDLESS_LOGIN_CALLBACK_URI` is set, it will override the config value.
Expand All @@ -31,7 +46,11 @@ module.exports = {
},
social: {
// Enables or disables social login for the site. Defaults to: false
{{#if answers.project.demo.enableDemoSettings}}
enabled: true,
{{else}}
enabled: false,
{{/if}}
// The third-party identity providers supported by your app. The PWA Kit supports Google and Apple by default.
// Additional IDPs will also need to be added to the IDP_CONFIG in the SocialLogin component.
idps: ['google', 'apple'],
Expand All @@ -51,9 +70,10 @@ module.exports = {
// The default site for your app. This value will be used when a siteRef could not be determined from the url
defaultSite: '{{answers.project.commerce.siteId}}',
// Provide aliases for your sites. These will be used in place of your site id when generating paths throughout the application.
// siteAliases: {
// RefArch: 'us'
// },
siteAliases: {
RefArch: 'us',
RefArchGlobal: 'global'
},
// The sites for your app, which is imported from sites.js
sites,
// Commerce api config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,59 @@
module.exports = [
{
id: '{{answers.project.commerce.siteId}}',
{{#ifEquals answers.project.commerce.siteId "RefArchGlobal" }}
l10n: {
supportedCurrencies: ['USD', 'GBP', 'EUR', 'CNY', 'JPY'],
defaultCurrency: 'USD',
defaultLocale: 'en-US',
supportedLocales: [
{
id: 'en-US',
preferredCurrency: 'USD'
},
{
id: 'en-GB',
preferredCurrency: 'GBP'
},
{
id: 'de-DE',
preferredCurrency: 'EUR'
},
{
id: 'es-MX',
preferredCurrency: 'MXN'
},
{
id: 'fr-FR',
preferredCurrency: 'EUR'
},
{
id: 'it-IT',
preferredCurrency: 'EUR'
},
{
id: 'ja-JP',
preferredCurrency: 'JPY'
},
{
id: 'ko-KR',
preferredCurrency: 'KRW'
},
{
id: 'pt-BR',
preferredCurrency: 'BRL'
},
{
id: 'zh-CN',
preferredCurrency: 'CNY'
},
{
id: 'zh-TW',
preferredCurrency: 'TWD'
}
]
}
{{else}}
l10n: {
supportedCurrencies: ['USD'],
defaultCurrency: 'USD',
Expand All @@ -22,5 +75,6 @@ module.exports = [
}
]
}
{{/ifEquals}}
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,14 @@ const Home = () => {
/>

<Hero
{{#if answers.project.demo.enableDemoSettings}}
title={intl.formatMessage({
defaultMessage: 'The React PWA Starter Store for Retail',
id: 'home.title.react_starter_store'
})}
{{else}}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small change here to make it more obvious in the demo site when locale is changed to another language.

title={CUSTOM_HOME_TITLE}
{{/if}}
img=\{{
src: getAssetUrl('static/img/hero.png'),
alt: 'npx pwa-kit-create-app'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,32 @@ module.exports = {
app: {
// Customize settings for your url
url: {
{{#if answers.project.demo.enableDemoSettings}}
// Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
// site: 'none',
site: 'path',
// Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
locale: 'none',
locale: 'path',
// This boolean value dictates whether default site or locale values are shown in the url. Defaults to: false
// showDefaults: true,
showDefaults: true,
{{else}}
// Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
site: 'none',
// Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
locale: 'none',
// This boolean value dictates whether or not default site or locale values are shown in the url. Defaults to: false
showDefaults: false,
{{/if}}
// This boolean value dictates whether the plus sign (+) is interpreted as space for query param string. Defaults to: false
interpretPlusSignAsSpace: false
},
login: {
passwordless: {
// Enables or disables passwordless login for the site. Defaults to: false
{{#if answers.project.demo.enableDemoSettings}}
enabled: true,
{{else}}
enabled: false,
{{/if}}
// The callback URI, which can be an absolute URL (including third-party URIs) or a relative path set up by the developer.
// Required in 'callback' mode; if missing, passwordless login defaults to 'sms' mode, which requires Marketing Cloud configuration.
// If the env var `PASSWORDLESS_LOGIN_CALLBACK_URI` is set, it will override the config value.
Expand All @@ -33,7 +46,11 @@ module.exports = {
},
social: {
// Enables or disables social login for the site. Defaults to: false
{{#if answers.project.demo.enableDemoSettings}}
enabled: true,
{{else}}
enabled: false,
{{/if}}
// The third-party identity providers supported by your app. The PWA Kit supports Google and Apple by default.
// Additional IDPs will also need to be added to the IDP_CONFIG in the SocialLogin component.
idps: ['google', 'apple'],
Expand All @@ -53,9 +70,10 @@ module.exports = {
// The default site for your app. This value will be used when a siteRef could not be determined from the url
defaultSite: '{{answers.project.commerce.siteId}}',
// Provide aliases for your sites. These will be used in place of your site id when generating paths throughout the application.
// siteAliases: {
// RefArch: 'us'
// },
siteAliases: {
RefArch: 'us',
RefArchGlobal: 'global'
},
// The sites for your app, which is imported from sites.js
sites,
// Commerce api config
Expand Down
Loading
Loading