Skip to content

Commit

Permalink
Support multiple domains (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinejaussoin authored Feb 24, 2023
1 parent 11ede58 commit 4324988
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 22 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Alpha Build'

on:
push:
branches: [v5000/separate-app]
branches: [v5000/xx]

jobs:
frontend:
Expand Down Expand Up @@ -99,6 +99,8 @@ jobs:
with:
builder: ${{ steps.buildx.outputs.name }}
file: marketing/Dockerfile
build-args: |
SUB_DOMAIN=www-beta
context: marketing
tags: retrospected/marketing:alpha
platforms: linux/amd64
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ jobs:
with:
builder: ${{ steps.buildx.outputs.name }}
file: marketing/Dockerfile
build-args: |
SUB_DOMAIN=www-beta
context: marketing
tags: retrospected/marketing:canary
platforms: linux/amd64,linux/arm64
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/marketing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Marketing Build'

on:
push:
branches: [v5000/marketing-final]
branches: [v5000/domains]

jobs:
marketing:
Expand Down Expand Up @@ -33,6 +33,8 @@ jobs:
with:
builder: ${{ steps.buildx.outputs.name }}
file: marketing/Dockerfile
build-args: |
SUB_DOMAIN=www-beta
context: marketing
tags: retrospected/marketing:alpha
platforms: linux/amd64
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ jobs:
with:
builder: ${{ steps.buildx.outputs.name }}
file: marketing/Dockerfile
build-args: |
SUB_DOMAIN=www
context: marketing
tags: retrospected/marketing:${{ steps.package.outputs.current-version }}
platforms: linux/amd64,linux/arm64
Expand Down
1 change: 1 addition & 0 deletions marketing/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ COPY . .

ARG NEXT_PUBLIC_MEASUREMENT_ID=APP_NEXT_PUBLIC_MEASUREMENT_ID
ARG NEXT_PUBLIC_APP_URL=APP_NEXT_PUBLIC_APP_URL
ARG SUB_DOMAIN=www
RUN yarn build

# If using npm comment out above and use below instead
Expand Down
8 changes: 5 additions & 3 deletions marketing/next-i18next.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
const subDomain = process.env.SUB_DOMAIN;

module.exports = {
i18n: {
defaultLocale: 'en',
locales: ['en', 'fr', 'de', 'nl'],
domains: [
{
domain: 'retrospected.com',
domain: `${subDomain}.retrospected.com`,
defaultLocale: 'en',
},
{
domain: 'retrospected.fr',
domain: `${subDomain}.retrospected.fr`,
defaultLocale: 'fr',
},
{
domain: 'retrospected.de',
domain: `${subDomain}.retrospected.de`,
defaultLocale: 'de',
}
],
Expand Down
8 changes: 1 addition & 7 deletions marketing/src/common/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import PropTypes from 'prop-types';
import NavbarStyle from './navbar.style';

type NavbarProps = {
Expand All @@ -8,12 +7,7 @@ type NavbarProps = {
navbarStyle?: any;
};

const Navbar = ({
className,
children,
navbarStyle,
...props
}: NavbarProps) => {
const Navbar = ({ className, children, navbarStyle }: NavbarProps) => {
const addAllClasses = ['reusecore__navbar'];

// className prop checking
Expand Down
19 changes: 9 additions & 10 deletions marketing/src/containers/WebAppCreative/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,15 @@ const Navbar = ({
menuItems={menuItems}
offset={-70}
/>
<Link href={`${appUrl}/subscribe`} legacyBehavior>
<a className="navbar_button navbar_button_one">
<Button {...button} title={t('Nav.subscribe')} />
</a>
</Link>
<Link href={appUrl!} legacyBehavior>
<a className="navbar_button navbar_button_two">
<Button {...button} title={t('Nav.login')} />
</a>
</Link>
<a
className="navbar_button navbar_button_one"
href={`${appUrl}/subscribe`}
>
<Button {...button} title={t('Nav.subscribe')} />
</a>
<a className="navbar_button navbar_button_two" href={appUrl!}>
<Button {...button} title={t('Nav.login')} />
</a>
<Drawer
width="420px"
placement="right"
Expand Down

0 comments on commit 4324988

Please sign in to comment.