Skip to content

Commit

Permalink
Merge pull request #66 from farabi-deriv/setup-env-variable-for-build…
Browse files Browse the repository at this point in the history
…-and-deploy-staging

farabi/setup-env-variable-for-build-and-deploy-staging
  • Loading branch information
sandeep-deriv authored Oct 1, 2024
2 parents 70a3a30 + a6815c4 commit 44a9c42
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build-and-deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ jobs:

- name: Build staging
run: npm run build
env:
R2_PROJECT_NAME: ${{ vars.R2_PROJECT_NAME }}
TRANSLATION_CDN_URL: ${{ vars.TRANSLATION_CDN_URL }}
CROWDIN_BRANCH_NAME: staging

- name: Run tests for Eslint
run: npm run test:lint
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-and-deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ jobs:

- name: Build staging
run: npm run build
env:
R2_PROJECT_NAME: ${{ vars.R2_PROJECT_NAME }}
TRANSLATION_CDN_URL: ${{ vars.TRANSLATION_CDN_URL }}
CROWDIN_BRANCH_NAME: staging

- name: Run tests for Eslint
run: npm run test:lint
Expand Down
3 changes: 2 additions & 1 deletion src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import AppContent from './app-content';

const queryClient = new QueryClient();

const i18nInstance = initializeI18n({ cdnUrl: 'https://cdn.example.com' });
const { TRANSLATION_CDN_URL, R2_PROJECT_NAME, CROWDIN_BRANCH_NAME } = process.env;
const i18nInstance = initializeI18n({ cdnUrl: `${TRANSLATION_CDN_URL}/${R2_PROJECT_NAME}/${CROWDIN_BRANCH_NAME}` });

function App() {
return (
Expand Down
4 changes: 2 additions & 2 deletions src/pages/dashboard/constants.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { localize } from '@/utils/tmp/dummy';
import { localize } from '@deriv-com/translations';

export type TSidebarItem = {
label: string;
content: { data: string; faq_id?: string }[];
link: boolean;
};

export const SIDEBAR_INTRO: TSidebarItem[] = [
export const SIDEBAR_INTRO = (): TSidebarItem[] => [
{
label: localize('Welcome to Deriv Bot!'),
content: [
Expand Down
2 changes: 1 addition & 1 deletion src/pages/dashboard/info-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const InfoPanel = observer(() => {
<LegacyClose1pxIcon height='18px' width='18px' />
</div>

{SIDEBAR_INTRO.map(sidebar_item => {
{SIDEBAR_INTRO().map(sidebar_item => {
const { label, content, link } = sidebar_item;
return (
<div key={`${label}-${content}`}>
Expand Down

0 comments on commit 44a9c42

Please sign in to comment.