Skip to content

Commit

Permalink
Merge pull request #12 from mayuran-deriv/mayuran/env-variable-add
Browse files Browse the repository at this point in the history
fix: env variable added
  • Loading branch information
mayuran-deriv authored Apr 2, 2024
2 parents 4729cbe + af43666 commit d593699
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 44 deletions.
1 change: 1 addition & 0 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/generate-preview-link-eu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -166,4 +167,4 @@ jobs:
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2
with:
name: 'pr-${{github.run_id}}'
path: .pr
path: .pr
7 changes: 4 additions & 3 deletions .github/workflows/generate-preview-link-row.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/generate-preview-link.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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

Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/production-eu.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
19 changes: 10 additions & 9 deletions .github/workflows/production-row.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
33 changes: 17 additions & 16 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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()
1 change: 1 addition & 0 deletions .github/workflows/staging-eu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/staging-row.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit d593699

Please sign in to comment.