From af43666a1daa780c3d56c691004c9fd72eaa6032 Mon Sep 17 00:00:00 2001 From: mayuran-deriv-dev96 Date: Tue, 2 Apr 2024 13:14:10 +0400 Subject: [PATCH] fix: env variable added --- .github/workflows/beta.yml | 1 + .../workflows/generate-preview-link-eu.yml | 9 ++--- .../workflows/generate-preview-link-row.yml | 7 ++-- .github/workflows/generate-preview-link.yml | 5 +-- .github/workflows/production-eu.yml | 19 ++++++----- .github/workflows/production-row.yml | 19 ++++++----- .github/workflows/production.yml | 33 ++++++++++--------- .github/workflows/staging-eu.yml | 1 + .github/workflows/staging-row.yml | 1 + .github/workflows/staging.yml | 1 + .../hooks/use-third-party-flags.tsx | 2 +- 11 files changed, 54 insertions(+), 44 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 1b482edd91e..e4fb5e12d59 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -24,6 +24,7 @@ env: GATSBY_RUDDERSTACK_PRODUCTION_KEY: ${{ secrets.GATSBY_RUDDERSTACK_PRODUCTION_KEY }} GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID: ${{ secrets.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID }} GATSBY_HOTJAR_ID: ${{ secrets.GATSBY_HOTJAR_ID }} + GATSBY_DATABASE_URL: ${{ secrets.GATSBY_DATABASE_URL }} jobs: release-beta: diff --git a/.github/workflows/generate-preview-link-eu.yml b/.github/workflows/generate-preview-link-eu.yml index 7f433fdb9f2..18d859a9375 100644 --- a/.github/workflows/generate-preview-link-eu.yml +++ b/.github/workflows/generate-preview-link-eu.yml @@ -17,8 +17,8 @@ jobs: build_eu_to_cloudflare_pages: runs-on: Ubuntu-latest permissions: - checks: write - pull-requests: write + checks: write + pull-requests: write steps: - name: Verify user uses: 'deriv-com/shared-actions/.github/actions/verify_user_in_organization@v1' @@ -67,7 +67,7 @@ jobs: sites/eu/.cache sites/eu/public - name: Install Dependencies - uses: "./.github/actions/npm_install_from_cache" + uses: './.github/actions/npm_install_from_cache' - name: Build project id: build-project @@ -81,6 +81,7 @@ jobs: GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID: ${{ secrets.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID }} GATSBY_TRUSTPILOT_API_KEY: ${{ secrets.GATSBY_TRUSTPILOT_API_KEY }} GATSBY_HOTJAR_ID: ${{ secrets.GATSBY_HOTJAR_ID }} + GATSBY_DATABASE_URL: ${{ secrets.GATSBY_DATABASE_URL }} run: npm run build:eu @@ -166,4 +167,4 @@ jobs: uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 with: name: 'pr-${{github.run_id}}' - path: .pr \ No newline at end of file + path: .pr diff --git a/.github/workflows/generate-preview-link-row.yml b/.github/workflows/generate-preview-link-row.yml index 702adc0b276..f8c8efdf79e 100644 --- a/.github/workflows/generate-preview-link-row.yml +++ b/.github/workflows/generate-preview-link-row.yml @@ -17,8 +17,8 @@ jobs: build_row_to_cloudflare_pages: runs-on: Ubuntu-latest permissions: - checks: write - pull-requests: write + checks: write + pull-requests: write steps: - name: Verify user uses: 'deriv-com/shared-actions/.github/actions/verify_user_in_organization@v1' @@ -69,7 +69,7 @@ jobs: sites/row/public - name: Install Dependencies - uses: "./.github/actions/npm_install_from_cache" + uses: './.github/actions/npm_install_from_cache' - name: Build project id: build-project @@ -83,6 +83,7 @@ jobs: GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID: ${{ secrets.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID }} GATSBY_TRUSTPILOT_API_KEY: ${{ secrets.GATSBY_TRUSTPILOT_API_KEY }} GATSBY_HOTJAR_ID: ${{ secrets.GATSBY_HOTJAR_ID }} + GATSBY_DATABASE_URL: ${{ secrets.GATSBY_DATABASE_URL }} run: npm run build:row diff --git a/.github/workflows/generate-preview-link.yml b/.github/workflows/generate-preview-link.yml index 0f1169dd093..d664c3322d7 100644 --- a/.github/workflows/generate-preview-link.yml +++ b/.github/workflows/generate-preview-link.yml @@ -17,8 +17,8 @@ jobs: build_to_cloudflare_pages: runs-on: Ubuntu-latest permissions: - checks: write - pull-requests: write + checks: write + pull-requests: write steps: - name: Verify user uses: 'deriv-com/shared-actions/.github/actions/verify_user_in_organization@v1' @@ -90,6 +90,7 @@ jobs: GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID: ${{ secrets.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID }} GATSBY_TRUSTPILOT_API_KEY: ${{ secrets.GATSBY_TRUSTPILOT_API_KEY }} GATSBY_HOTJAR_ID: ${{ secrets.GATSBY_HOTJAR_ID }} + GATSBY_DATABASE_URL: ${{ secrets.GATSBY_DATABASE_URL }} run: npm run build diff --git a/.github/workflows/production-eu.yml b/.github/workflows/production-eu.yml index 4bf90a9a9ff..ee78cd7400a 100644 --- a/.github/workflows/production-eu.yml +++ b/.github/workflows/production-eu.yml @@ -1,11 +1,11 @@ name: Production CF for EU on: - push: - tags: - - 'production*' - paths-ignore: - - '**.md' + push: + tags: + - 'production*' + paths-ignore: + - '**.md' env: GATSBY_CPU_COUNT: 16 @@ -21,6 +21,7 @@ env: GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID: ${{ secrets.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID }} GATSBY_TRUSTPILOT_API_KEY: ${{ secrets.GATSBY_TRUSTPILOT_API_KEY }} GATSBY_HOTJAR_ID: ${{ secrets.GATSBY_HOTJAR_ID }} + GATSBY_DATABASE_URL: ${{ secrets.GATSBY_DATABASE_URL }} jobs: release-production: @@ -59,7 +60,7 @@ jobs: run: echo "New website - http://eu-deriv-com-pages.pages.dev" - name: upload-artifact uses: actions/upload-artifact@v4 - with: - name: production - path: sites/eu/public - retention-days: 5 + with: + name: production + path: sites/eu/public + retention-days: 5 diff --git a/.github/workflows/production-row.yml b/.github/workflows/production-row.yml index 5f662a99a00..a823dc5c4b2 100644 --- a/.github/workflows/production-row.yml +++ b/.github/workflows/production-row.yml @@ -1,11 +1,11 @@ name: Production CF for Row on: - push: - tags: - - 'production*' - paths-ignore: - - '**.md' + push: + tags: + - 'production*' + paths-ignore: + - '**.md' env: GATSBY_CPU_COUNT: 16 @@ -21,6 +21,7 @@ env: GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID: ${{ secrets.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID }} GATSBY_TRUSTPILOT_API_KEY: ${{ secrets.GATSBY_TRUSTPILOT_API_KEY }} GATSBY_HOTJAR_ID: ${{ secrets.GATSBY_HOTJAR_ID }} + GATSBY_DATABASE_URL: ${{ secrets.GATSBY_DATABASE_URL }} jobs: release-production: @@ -60,7 +61,7 @@ jobs: run: echo "New website - http://row-deriv-com-pages.pages.dev" - name: upload-artifact uses: actions/upload-artifact@v4 - with: - name: production - path: sites/row/public - retention-days: 5 + with: + name: production + path: sites/row/public + retention-days: 5 diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index 9df383abcc9..9b905693912 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -21,6 +21,7 @@ env: GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID: ${{ secrets.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID }} GATSBY_TRUSTPILOT_API_KEY: ${{ secrets.GATSBY_TRUSTPILOT_API_KEY }} GATSBY_HOTJAR_ID: ${{ secrets.GATSBY_HOTJAR_ID }} + GATSBY_DATABASE_URL: ${{ secrets.GATSBY_DATABASE_URL }} jobs: release-production: @@ -68,10 +69,10 @@ jobs: run: echo "New website - http://cf-pages-deriv-com.deriv.com" - name: upload-artifact uses: actions/upload-artifact@v4 - with: - name: production - path: public - retention-days: 5 + with: + name: production + path: public + retention-days: 5 - name: Slack Notification 📣 uses: 8398a7/action-slack@v3 with: @@ -125,11 +126,11 @@ jobs: - name: Deploy 🚀 id: build_and_push_docker_image env: - KUBE_SERVER: ${{ secrets.KUBE_SERVER }} - SERVICEACCOUNT_TOKEN: ${{ secrets.SERVICEACCOUNT_TOKEN }} - CA_CRT: ${{ secrets.CA_CRT }} - NAMESPACE: deriv-com-production - DOCKERHUB_ORGANISATION: ${{ secrets.DOCKERHUB_ORGANISATION }} + KUBE_SERVER: ${{ secrets.KUBE_SERVER }} + SERVICEACCOUNT_TOKEN: ${{ secrets.SERVICEACCOUNT_TOKEN }} + CA_CRT: ${{ secrets.CA_CRT }} + NAMESPACE: deriv-com-production + DOCKERHUB_ORGANISATION: ${{ secrets.DOCKERHUB_ORGANISATION }} run: | git clone https://github.com/binary-com/devops-ci-scripts cd devops-ci-scripts/k8s-build_tools @@ -144,12 +145,12 @@ jobs: fields: workflow,repo if_mention: failure,cancelled custom_payload: | - { - attachments: [{ - color: '${{ job.status }}' === 'failure' ? 'danger' : 'warning', - text: `Release for *Deriv.com* with version *$GIT_TAG_NAME* has failed` - }] - } + { + attachments: [{ + color: '${{ job.status }}' === 'failure' ? 'danger' : 'warning', + text: `Release for *Deriv.com* with version *$GIT_TAG_NAME* has failed` + }] + } env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} if: failure() diff --git a/.github/workflows/staging-eu.yml b/.github/workflows/staging-eu.yml index ce3e5e75b5f..9df966d759a 100644 --- a/.github/workflows/staging-eu.yml +++ b/.github/workflows/staging-eu.yml @@ -26,6 +26,7 @@ env: GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID: ${{ secrets.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID }} GATSBY_TRUSTPILOT_API_KEY: ${{ secrets.GATSBY_TRUSTPILOT_API_KEY }} GATSBY_HOTJAR_ID: ${{ secrets.GATSBY_HOTJAR_ID }} + GATSBY_DATABASE_URL: ${{ secrets.GATSBY_DATABASE_URL }} jobs: release-staging: diff --git a/.github/workflows/staging-row.yml b/.github/workflows/staging-row.yml index c752f8410cd..c97b1a219ac 100644 --- a/.github/workflows/staging-row.yml +++ b/.github/workflows/staging-row.yml @@ -26,6 +26,7 @@ env: GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID: ${{ secrets.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID }} GATSBY_TRUSTPILOT_API_KEY: ${{ secrets.GATSBY_TRUSTPILOT_API_KEY }} GATSBY_HOTJAR_ID: ${{ secrets.GATSBY_HOTJAR_ID }} + GATSBY_DATABASE_URL: ${{ secrets.GATSBY_DATABASE_URL }} jobs: release-staging: diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index c983dd91d66..6ec3155d495 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -26,6 +26,7 @@ env: GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID: ${{ secrets.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID }} GATSBY_TRUSTPILOT_API_KEY: ${{ secrets.GATSBY_TRUSTPILOT_API_KEY }} GATSBY_HOTJAR_ID: ${{ secrets.GATSBY_HOTJAR_ID }} + GATSBY_DATABASE_URL: ${{ secrets.GATSBY_DATABASE_URL }} jobs: release-staging: diff --git a/themes/gatsby-theme-deriv/src/components/hooks/use-third-party-flags.tsx b/themes/gatsby-theme-deriv/src/components/hooks/use-third-party-flags.tsx index 41ff19b81e0..e11d76ea282 100644 --- a/themes/gatsby-theme-deriv/src/components/hooks/use-third-party-flags.tsx +++ b/themes/gatsby-theme-deriv/src/components/hooks/use-third-party-flags.tsx @@ -5,7 +5,7 @@ import { getDatabase, ref, onValue } from 'firebase/database' import featuresConfig from '../../../static/appConfig' const thirdPartyFlagsConfig = { - databaseURL: 'https://app-config-staging.firebaseio.com', + databaseURL: process.env.GATSBY_DATABASE_URL, } const useThirdPartyFlags = (featurePath) => {