Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
[translators] Update translators branch with master 📚 (#7308)
Browse files Browse the repository at this point in the history
* Hasan/Pr 00 flicker regression 1 (#7134)

* chore: test workflow

* fix: footer disclaimer issue

* chore: test workflow

* fix: footer disclaimer

* feat: testing flickering (#7139)

* feat: testing flickering

* feat: udpate use auth check

---------

Co-authored-by: Wojciech Brygola <[email protected]>

* agrim/DPROD-1855/image changes (#7069)

* fix: replacing blurred images

* revert: reverted unordered code

* fix: replacing blurry images

* fix: capital letter for i in step index

* fix: capital letter for i

* chore: adding the derivx images and replacing blurred ones

* chore: remove country restriction inside the codebase (#7132)

* Konstantinos/DPROD-3217/Update payment methods (#7047)

* feat: update payment methods

* feat: update string

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* auto-pull-translation

* feat: empty commit

* feat: fix comma and currency

* fix: equitel values

* fix: equitel values

* fix: logos

* fix: mobile payments values request for change again

* feat: update values

---------

Co-authored-by: DerivFE <[email protected]>

* Agrim/DPROD-3441/Set disclaimer on trade specifications (#7095)

* text: disclaimer on trade specifications

* auto-pull-translation

* fix: resolve conflict

* fix: fixing the error

* fix: resolve conflicts

* auto-pull-translation

* fix: resolve conflict

* fix: fixing the error

* fix: resolve conflict

* auto-pull-translation

* fix: resolve conflict

* fix: fixing the error

* fix: resolve conflict

* auto-pull-translation

* fix: resolve conflict

* fix: fixing the error

* hasan/DPROD-3322/Created actions for row and eu build (#7157)

* chore: test workflow

* chore: added preview workflow for row and eu

* chore: fixed preview workflow for row and eu

* chore: added group

* Update .github/actions/npm_install_from_cache/action.yml

Co-authored-by: Ali(Ako) Hosseini <[email protected]>

* Update .github/actions/npm_install_from_cache/action.yml

Co-authored-by: Ali(Ako) Hosseini <[email protected]>

* Update .github/workflows/generate-preview-link-row.yml

Co-authored-by: Ali(Ako) Hosseini <[email protected]>

* Update .github/workflows/generate-preview-link-eu.yml

Co-authored-by: Ali(Ako) Hosseini <[email protected]>

* Update .github/workflows/generate-preview-link-row.yml

Co-authored-by: Ali(Ako) Hosseini <[email protected]>

* Update .github/workflows/generate-preview-link-row.yml

Co-authored-by: Ali(Ako) Hosseini <[email protected]>

* Update .github/workflows/generate-preview-link-eu.yml

Co-authored-by: Ali(Ako) Hosseini <[email protected]>

* Update .github/workflows/generate-preview-link-row.yml

Co-authored-by: Ali(Ako) Hosseini <[email protected]>

---------

Co-authored-by: Ali(Ako) Hosseini <[email protected]>

* Pr 00 workflow fix (#7173)

* chore: test workflow

* chore: added shell to action

* chore: removed generate-preview-link-row-eu

* Pr 00 workflow fix 3 (#7178)

* chore: test workflow

* chore: fixed preview url issue

* chore: removed row eu workflow

* Pr 00 workflow fix 4 (#7182)

* chore: test workflow

* chore: removed

* chore: test

* chore: test

* chore: fixed preview link workflow

* Agrim/DPROD-3557/Translation 3557 footer change (#7158)

* text: updating footer text

* text: updating the text in the footer for EU and CPA

* text: terms and conditions edit of text

* text: edit the text

* text: formatting the text

* fix: changes in the text links

* fix: fixing t&c, risk disclosure, secure links

* auto-pull-translation

* auto-pull-translation

* fix: modifications in footer

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* fix: changes in the text links

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* fix: to redeploy and trigger build

* auto-pull-translation

* fix: to redeploy and trigger build

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* Agrim/DPROD-3441/Set disclaimer on trade specifications (#7095)

* text: disclaimer on trade specifications

* auto-pull-translation

* fix: resolve conflict

* fix: fixing the error

* fix: resolve conflicts

* auto-pull-translation

* fix: resolve conflict

* fix: fixing the error

* fix: resolve conflict

* auto-pull-translation

* fix: resolve conflict

* fix: fixing the error

* fix: resolve conflict

* auto-pull-translation

* fix: resolve conflict

* fix: fixing the error

* text: updating footer text

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* fix: to redeploy and trigger build

* auto-pull-translation

* fix: to redeploy and trigger build

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* fix: resolve conflict

* fix: resolve conflict

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* fix: to redeploy and trigger build

* auto-pull-translation

* fix: to redeploy and trigger build

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* fix: resolve conflict

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* fix: to redeploy and trigger build

* auto-pull-translation

* fix: to redeploy and trigger build

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* fix: resolve conflict

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

---------

Co-authored-by: DerivFE <[email protected]>
Co-authored-by: prince-deriv <[email protected]>

* Agrim/DPROD-3025/Replace the spanish row pdf's with english to spanish pdf's (#7128)

* fix: replacing the spanish row pdf's with english to spanish pdf's

* fix: remove spaces from pdf name

* behnaz/DPROD-3359/Feb trading data (#7060)

* chorn: fx row

* chorn: derived  row

* chorn: derived  coma row

* chorn: derived add quet  row

* chorn: derived add quet2  row

* chorn: stock row

* chorn: stock GBP row

* chorn: etfs  row

* chorn: etfs remove extra 1 row

* chorn: crypto row

* chorn: crypto base row

* chorn: comod row

* chorn: comod EU

* chorn: fx  EU

* chorn: derived  EU

* chorn: stock  EU

* chorn: etfs  EU

* chorn: crypto  EU

* mayuran/DPROD-2759/ws_improvements (#7070)

* fix: wip

* fix: dummy initial

* fix: check socket

* fix: added conditionsa

* fix: ws call

* fix: ws reconnect

* fix: check api manager

* chore: trigger vercel

* fix: ws socket calls

* fix: session storage

* fix: window added

* fix: addded window

* fix: remove unwanted code

* fix: check

* fix: kogs

* fix: ready state

* fix: code clear

* fix: added logs

* fix: minor issue in reconnect

* fix: loading changed logic

* fix: remove session storage

* Revert "fix: remove session storage"

This reverts commit abb84c3.

* fix: remove session storage

* fix: improvement of use WS

* fix: remove console logs (#7201)

* Update smoketests.yml - change e2e skip term (#7194)

* Update smoketests.yml - change e2e skip term

If the term 'skipsm' is specified in the branch name then skip the e2e tests (used to be 'quill').

This is because the dev knows they are making radical change which will need the tests to be modified at a later date.

* Update smoketests.yml - Modified to use DRAFT param

Skip smoket test if the PR is in Draft mode.

* Update generate-preview-link.yml - Add DRAFT param (#7198)

We need to store a new param to GH storage, DRAFT. So that the smoketest.yml can use it to ignore a test run.

* Fasih/DPROD-3590/integrate firebase feature flag for third party items (#7149)

* feat: implement json which contain items name

* feat: adding flag on third party packages

* feat: implemented flag on trade platfrom apps

* feat: removed unsued code

* feat: made some items value false

* feat: enabled all items

* feat: add condition for derivgo footer badge

* feat: updated keys

* feat: interated api and hook

* feat: updated hook with importing function

* feat: updated hook and filtered footer icon data

* feat: remvoed hotjar and gtm from flags

* feat: removed unused code

* feat: made every item true

* feat: updated other layout files

* feat: updated the condition

---------

Co-authored-by: fasihali-deriv <[email protected]>
Co-authored-by: Muhammad Fasih Ali Naqvi <[email protected]>

* chore: update multiple build action yml (#7210)

* chore: update multiple build action yml

* chore: update action with To DO

* Update smoketests.yml - Mod to draft param (#7217)

* Update smoketests.yml - Mod to draft param

The draft param wasn't being interpretted correctly.

* Update smoketests.yml

* chore: updated the config url (#7223)

Co-authored-by: Muhammad Fasih Ali Naqvi <[email protected]>

* chore: update icon file (#7151)

* behnaz/MARK-1066/phone-8d (#7185)

* chore: phone 8 d

* chore: add the phone length

* chore: decrease padding in tablet (#7152)

* Agrim/DPROD-2993/Translation 2993 meta changes dtrader (#7168)

* fix: changing name and description of dTrader seo

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* fix: meta attributes

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* fix: empty commit

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* fix: empty commit

* fix: empty commit

---------

Co-authored-by: DerivFE <[email protected]>
Co-authored-by: Agrim Jain <[email protected]>

* Aswathy/DPROD-3448/Deriv Academy new Sign Up flow (#7090)

* feat: new signup page

* fix: redirection of login page

* feat: academy app id redirection for login

* fix: window error issue

* fix: window error

* fix: app id connection and login page

* fix: changed the url flow for academy signup flow

* fix: passowrd changes

* fix: validation for password

* fix: password feature button

* fix: added the token auth

* fix: added authorized token

* fix: background color issue

* fix: redirection of url to thinkific

* fix: authorize the api call

* fix: redirection of language to english only

* fix: for handling the response for the country

* fix: flickering logo issue

* fix: flickering logo issue with use state

* fix: flickering logo

* fix: created the academy nav logo

* fix: logo fix flicker

* fix: password page

* fix: country selection and disabling button

* fix: redirection issue

* fix: logo issue

* fix: translations issue

* fix: logo issue

* fix: changed the logo

* fix: minimized the logo size

* fix: dropdown issues

* fix: sonar cloud issues

* fix: issues in the design

* fix: dropdown is reverted to old one

* fix: dropdown issues

* fix: removed the button width for residence page

* fix: focus blur

* fix: added the dropdown search changes

* fix: changed the css file

* fix: renamed the css file

* fix: percy issues

* fix: percy run issue

* fix: renamed the password files

* fix: sonarcloud issues

* Agrim/DPROD-3466/fix: color intensity hero (#7141)

* fix: color intensity hero

* fix: color intensity 2

* fix: improve resolution of image

* fix: fix the photo resolution

* fix: webp to png fix

* fix: changing the image to optimize performance

* fix: changing the image to optimize performance

* fix: update the image

* fix: update photo

* fix: resolution fix of image

* fix: make the relevant changes to the image

* fix: fixing the styling

* fix: making required changes

* fix: empty commit

* fix: empty commit

---------

Co-authored-by: Agrim Jain <[email protected]>

* Agrim/DPROD-3532/fix: changed the award (#7121)

* fix: changed the award

* fix: changed award and fix the sizing issue

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* fix: empty commit

* fix: empty commit

* fix: empty commit

* fix: empty commit

---------

Co-authored-by: DerivFE <[email protected]>
Co-authored-by: Agrim Jain <[email protected]>

* fix: minified error (#7255)

* feat: adding ctrader to carousel (#7235)

Co-authored-by: Agrim Jain <[email protected]>

* behnaz/MARK-1003/lead to deriv.com (#7086)

* chore: url lead to  deriv.com

* chore: url lead to  affiliate-ib

* chore: remove the extra space

* fix: initial contact us page (#7226)

* Agrim/DPROD-3654/Translation 3654 translation for the footer with links (#7247)

* fix: incorrect links in the ROW footer

* fix: fixes in the text

* fix: fixing the cpa issue

* fix: capital letters on the links

* auto-pull-translation

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* fix: empty commit

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* fix: empty commit

* fix: empty commit

* fix: empty commit

* fix: deleting telgram from cpa

---------

Co-authored-by: Agrim Jain <[email protected]>
Co-authored-by: DerivFE <[email protected]>

* Hasan/DPROD-3530/platform overlap issue (#7234)

* chore: fixed platform swiper overflow issue

* chore: fixed platform overlay for tr lang

* chore: fixed swiper pagination in responsive device

* chore: fixed link css issue

* empty: 🚀 to redeploy and trigger build

* chore: fixed rtl and font size issue

* chore: fixed spacing for tr

* chore: fixed pagination spacing

* chore: fixed learn more link

* chore: fixed learn more link font size

* chore: fixed learn more link font size

* empty: 🚀 to redeploy and trigger build

---------

Co-authored-by: aswathy-deriv <[email protected]>

* mayuran/DPROD-3373/Update 'Deal cancellation' (#6985)

* fix: translation change

* chore: trigger vercel

* fix: change

* fix: message

* fix: text issue multiplier

* fix: revert

* chore: trigger vercel

* chore: trigger vercel

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* chore: trigger vercel

* fix: deal cancelation

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* chore: trigger vercel

* fix: row word

* fix: stop out text

* fix: step out text

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* chore: trigger vercel

---------

Co-authored-by: DerivFE <[email protected]>

* mayuran/DPROD-3544/accumulator-update (#7208)

* feat: option revamp

* feat: change description

* auto-pull-translation

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* fix: translations trigger empty commit

* fix: translations on questions

* fix: translation for button

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* fix: review comments

* fix: slider for mobile

* feat: master merge

* fix: initial accumulator page

* fix: image issue

* fix: image change

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* fix: remove script

* chore: trigger vercel

* fix: img

* fix: trade hub button

* fix: remove unwanted code

* fix: sub tasks

* fix: id added

* fix: packages updated

* fix:  try

* fix: try float

* fix: float

* fix: float

* chore: trigger vercel

* fix: floating in options

* auto-pull-translation

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* chore: trigger vercel

* fix: tab padding

* auto-pull-translation

* translation: 📚 sync translations from crowdin feature branch

* fix: redirection

* fix: gap

* fix: font sixe

* fix: options layout

* fix: text color

* fix: color

---------

Co-authored-by: “konstantinosG-deriv” <[email protected]>
Co-authored-by: DerivFE <[email protected]>

* patch fix (#7291)

* fix: digital options

* fix: breadcrumbs

* chore: extract unextracted strings (#7298)

* Stp 468 amir/cro 468/signup page ab test content (#7290)

* feat: add ab test on signup content

* chore: rename component name

* chore: update translation literal in messages.json file

* auto-pull-translation

* chore: sync translations

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* auto-pull-translation

* chore: sync translations from crowdin

* auto-pull-translation

* auto-pull-translation

* chore: sync translations from crowdin

* chore: removed dashboard from p2p and deriv go also updated config (#7233)

Co-authored-by: Muhammad Fasih Ali Naqvi <[email protected]>

* fix: fixed new tab issue (#7256)

Co-authored-by: Lipika Sethi <[email protected]>

---------

Co-authored-by: Hasan Mobarak <[email protected]>
Co-authored-by: Wojciech Brygola <[email protected]>
Co-authored-by: Wojciech Brygola <[email protected]>
Co-authored-by: Agrim Jain <[email protected]>
Co-authored-by: amir ali <[email protected]>
Co-authored-by: konstantinosG-deriv <[email protected]>
Co-authored-by: DerivFE <[email protected]>
Co-authored-by: Ali(Ako) Hosseini <[email protected]>
Co-authored-by: prince-deriv <[email protected]>
Co-authored-by: behnaz <[email protected]>
Co-authored-by: mayuran-deriv <[email protected]>
Co-authored-by: markodonnell-deriv <[email protected]>
Co-authored-by: fasihali-deriv <[email protected]>
Co-authored-by: fasihali-deriv <[email protected]>
Co-authored-by: Muhammad Fasih Ali Naqvi <[email protected]>
Co-authored-by: Habib Deriv <[email protected]>
Co-authored-by: Agrim Jain <[email protected]>
Co-authored-by: Aswathy-Deriv <[email protected]>
Co-authored-by: aswathy-deriv <[email protected]>
Co-authored-by: prince-deriv <[email protected]>
Co-authored-by: lipika-deriv <[email protected]>
Co-authored-by: Lipika Sethi <[email protected]>
  • Loading branch information
23 people authored Mar 14, 2024
1 parent df7c4ed commit 7475754
Show file tree
Hide file tree
Showing 214 changed files with 12,976 additions and 10,164 deletions.
17 changes: 17 additions & 0 deletions .github/actions/npm_install_from_cache/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: npm_install_from_cache
description: Install npm packages from cache
runs:
using: composite
steps:
- name: Get cached dependencies
id: cache-npm
uses: actions/cache/restore@e12d46a63a90f2fae62d114769bbf2a179198b5c
with:
path: node_modules
key: npm-${{ hashFiles('./package-lock.json') }}

- name: Install dependencies
if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
run: npm ci
shell: bash

182 changes: 182 additions & 0 deletions .github/workflows/generate-preview-link-eu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
name: Generate EU preview link

on:
pull_request_target:
types: [opened, synchronize]
branches:
- '**'

env:
NODE_OPTIONS: '--max-old-space-size=8192'

concurrency:
group: cloudflare-eu-pages-build-${{github.head_ref}}
cancel-in-progress: true

jobs:
build_eu_to_cloudflare_pages:
runs-on: Ubuntu-latest
if: contains(github.event.pull_request.head.ref, 'multiple-build')
permissions:
checks: write
pull-requests: write
steps:
- name: Verify user
uses: 'deriv-com/shared-actions/.github/actions/verify_user_in_organization@v1'
with:
username: ${{github.event.pull_request.user.login}}
token: ${{ secrets.PREVIEW_LINK_TOKEN }}

- name: Checkout to repo
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: 'Generate action link comment'
id: generate_action_url
uses: actions/github-script@ffc2c79a5b2490bd33e0a41c1de74b877714d736
with:
github-token: ${{ github.token }}
script: |
const action_url = "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"
const comment = [
'| Name | Result |',
'| :--- | :------ |',
`| **EU Build status** | Building 🔨 |`,
`| **EU Action URL** | [Visit Action](${action_url}) |`,
''
].join('\n')
core.setOutput("comment", comment);
- name: Post Cloudflare Pages Preview comment
uses: marocchino/sticky-pull-request-comment@efaaab3fd41a9c3de579aba759d2552635e590fd
with:
header: Cloudflare Pages EU Preview Comment
number: ${{github.event.pull_request.user.login}}
message: ${{steps.generate_action_url.outputs.comment}}
recreate: true

- name: Setup node
uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8

- name: Create npmrc file
shell: bash
run: echo "@deriv-com:registry=https://npm.pkg.github.com" >> .npmrc

- name: Setup install read-only token for deriv-com org
shell: bash
run: echo '//npm.pkg.github.com/:_authToken=${{ secrets.READ_DERIV_COM_ORG_PACKAGES }}' >> .npmrc

- name: Get build output from master cache
uses: actions/cache/restore@e12d46a63a90f2fae62d114769bbf2a179198b5c
with:
key: master-cache-public
restore-keys: |
master-cache-public-replica
path: |
sites/eu/.cache
sites/eu/public
- name: Install Dependencies
uses: "./.github/actions/npm_install_from_cache"

- name: Build project
id: build-project
env:
GATSBY_ENV: staging
GATSBY_GROWTHBOOK_CLIENT_KEY: ${{ secrets.GATSBY_GROWTHBOOK_CLIENT_KEY }}
GATSBY_GROWTHBOOK_DECRYPTION_KEY: ${{ secrets.GATSBY_GROWTHBOOK_DECRYPTION_KEY }}
GATSBY_RUDDERSTACK_STAGING_KEY: ${{ secrets.GATSBY_RUDDERSTACK_STAGING_KEY }}
GATSBY_RUDDERSTACK_PRODUCTION_KEY: ${{ secrets.GATSBY_RUDDERSTACK_PRODUCTION_KEY }}
GATSBY_STRAPI_TOKEN: ${{ secrets.GATSBY_STRAPI_TOKEN }}
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 }}

run: npm run build:eu

- name: Retrieve PR information
env:
EVENT_NUMBER: ${{ github.event.number }}
EVENT_USERNAME: ${{ github.event.pull_request.user.login }}
HEAD_REF: ${{ github.head_ref }}
run: |
mkdir -p .pr
echo "$EVENT_NUMBER" > .pr/NR
echo "$EVENT_USERNAME" > .pr/USERNAME
echo "$HEAD_REF" > .pr/BRANCHNAME
- name: Publish to Cloudflare Pages
id: publish-to-pages
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_TEST_LINKS_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_TEST_LINKS_ACCOUNT_ID }}
HEAD_BRANCH: ${{ github.head_ref }}
run: |
echo "Installing Wrangler CLI"
npm i -g wrangler
echo "Deploying build to Cloudflare Pages"
directory='sites/eu/public'
projectName='deriv-com-preview-links'
branch=eu-$(echo "$HEAD_BRANCH" | head -c 20 | sed 's/[\/_\.]/-/g; s/[^a-zA-Z0-9]$/1/')
cf_preview_url=$(wrangler pages deploy $directory --project-name=$projectName --branch=$branch > log.txt 2>&1; echo $?)
echo "------"
preview_url=https://$branch.deriv-com-preview-links.pages.dev
cat log.txt
if grep -q "Deployment complete" log.txt; then
echo "preview_url=$preview_url" >> "$GITHUB_OUTPUT"
echo $preview_url > .pr/PREVIEW_URL
else
echo "Deployment to Cloudflare Pages failed."
exit 1
fi
- name: 'Generate preview link comment'
if: success()
id: generate_preview_url
uses: actions/github-script@ffc2c79a5b2490bd33e0a41c1de74b877714d736
with:
github-token: ${{ github.token }}
script: |
const action_url = "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"
const preview_url = "${{steps.publish-to-pages.outputs.preview_url}}"
const comment = [
`**Preview Link**: ${preview_url}`,
'| Name | Result |',
'| :--- | :------ |',
`| **EU Build status** | Completed ✅ |`,
`| **EU Preview URL** | [Visit Preview](${preview_url}) |`,
`| **EU Action URL** | [Visit Action](${action_url}) |`,
''
].join('\n')
core.setOutput("comment", comment);
- name: 'Generate failure comment'
if: failure()
id: generate_failure_comment
uses: actions/github-script@ffc2c79a5b2490bd33e0a41c1de74b877714d736
with:
github-token: ${{ github.token }}
script: |
const action_url = "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"
const comment = [
'| Name | Result |',
'| :--- | :------ |',
`| **EU Build status** | Failed ❌ |`,
`| **EU Action URL** | [Visit Action](${action_url}) |`,
''
].join('\n')
core.setOutput("comment", comment);
- name: Post Cloudflare Pages Preview comment
if: success() || failure()
uses: marocchino/sticky-pull-request-comment@efaaab3fd41a9c3de579aba759d2552635e590fd
with:
header: Cloudflare Pages Preview Comment
number: ${{github.event.number}}
message: ${{steps.generate_preview_url.outputs.comment || steps.generate_failure_comment.outputs.comment }}
recreate: true

- name: Upload PR information to artifact
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2
with:
name: 'pr-${{github.run_id}}'
path: .pr
183 changes: 183 additions & 0 deletions .github/workflows/generate-preview-link-row.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
name: Generate ROW preview link

on:
pull_request_target:
types: [opened, synchronize]
branches:
- '**'

env:
NODE_OPTIONS: '--max-old-space-size=8192'

concurrency:
group: cloudflare-row-pages-build-${{github.head_ref}}
cancel-in-progress: true

jobs:
build_row_to_cloudflare_pages:
runs-on: Ubuntu-latest
# To be removed once released in production
if: contains(github.event.pull_request.head.ref, 'multiple-build')
permissions:
checks: write
pull-requests: write
steps:
- name: Verify user
uses: 'deriv-com/shared-actions/.github/actions/verify_user_in_organization@v1'
with:
username: ${{github.event.pull_request.user.login}}
token: ${{ secrets.PREVIEW_LINK_TOKEN }}

- name: Checkout to repo
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: 'Generate action link comment'
id: generate_action_url
uses: actions/github-script@ffc2c79a5b2490bd33e0a41c1de74b877714d736
with:
github-token: ${{ github.token }}
script: |
const action_url = "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"
const comment = [
'| Name | Result |',
'| :--- | :------ |',
`| **ROW Build status** | Building 🔨 |`,
`| **ROW Action URL** | [Visit Action](${action_url}) |`,
''
].join('\n')
core.setOutput("comment", comment);
- name: Post Cloudflare Pages Preview comment
uses: marocchino/sticky-pull-request-comment@efaaab3fd41a9c3de579aba759d2552635e590fd
with:
header: Cloudflare Pages ROW Preview Comment
number: ${{github.event.pull_request.user.login}}
message: ${{steps.generate_action_url.outputs.comment}}
recreate: true

- name: Setup node
uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8

- name: Create npmrc file
shell: bash
run: echo "@deriv-com:registry=https://npm.pkg.github.com" >> .npmrc

- name: Setup install read-only token for deriv-com org
shell: bash
run: echo '//npm.pkg.github.com/:_authToken=${{ secrets.READ_DERIV_COM_ORG_PACKAGES }}' >> .npmrc

- name: Get build output from master cache
uses: actions/cache/restore@e12d46a63a90f2fae62d114769bbf2a179198b5c
with:
key: master-cache-public
restore-keys: |
master-cache-public-replica
path: |
sites/row/.cache
sites/row/public
- name: Install Dependencies
uses: "./.github/actions/npm_install_from_cache"

- name: Build project
id: build-project
env:
GATSBY_ENV: staging
GATSBY_GROWTHBOOK_CLIENT_KEY: ${{ secrets.GATSBY_GROWTHBOOK_CLIENT_KEY }}
GATSBY_GROWTHBOOK_DECRYPTION_KEY: ${{ secrets.GATSBY_GROWTHBOOK_DECRYPTION_KEY }}
GATSBY_RUDDERSTACK_STAGING_KEY: ${{ secrets.GATSBY_RUDDERSTACK_STAGING_KEY }}
GATSBY_RUDDERSTACK_PRODUCTION_KEY: ${{ secrets.GATSBY_RUDDERSTACK_PRODUCTION_KEY }}
GATSBY_STRAPI_TOKEN: ${{ secrets.GATSBY_STRAPI_TOKEN }}
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 }}

run: npm run build:row

- name: Retrieve PR information
env:
EVENT_NUMBER: ${{ github.event.number }}
EVENT_USERNAME: ${{ github.event.pull_request.user.login }}
HEAD_REF: ${{ github.head_ref }}
run: |
mkdir -p .pr
echo "$EVENT_NUMBER" > .pr/NR
echo "$EVENT_USERNAME" > .pr/USERNAME
echo "$HEAD_REF" > .pr/BRANCHNAME
- name: Publish to Cloudflare Pages
id: publish-to-pages
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_TEST_LINKS_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_TEST_LINKS_ACCOUNT_ID }}
HEAD_BRANCH: ${{ github.head_ref }}
run: |
echo "Installing Wrangler CLI"
npm i -g wrangler
echo "Deploying build to Cloudflare Pages"
directory='sites/row/public'
projectName='deriv-com-preview-links'
branch=row-$(echo "$HEAD_BRANCH" | head -c 20 | sed 's/[\/_\.]/-/g; s/[^a-zA-Z0-9]$/1/')
cf_preview_url=$(wrangler pages deploy $directory --project-name=$projectName --branch=$branch > log.txt 2>&1; echo $?)
echo "------"
preview_url=https://$branch.deriv-com-preview-links.pages.dev
cat log.txt
if grep -q "Deployment complete" log.txt; then
echo "preview_url=$preview_url" >> "$GITHUB_OUTPUT"
echo $preview_url > .pr/PREVIEW_URL
else
echo "Deployment to Cloudflare Pages failed."
exit 1
fi
- name: 'Generate preview link comment'
if: success()
id: generate_preview_url
uses: actions/github-script@ffc2c79a5b2490bd33e0a41c1de74b877714d736
with:
github-token: ${{ github.token }}
script: |
const action_url = "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"
const preview_url = "${{steps.publish-to-pages.outputs.preview_url}}"
const comment = [
`**Preview Link**: ${preview_url}`,
'| Name | Result |',
'| :--- | :------ |',
`| **ROW Build status** | Completed ✅ |`,
`| **ROW Preview URL** | [Visit Preview](${preview_url}) |`,
`| **ROW Action URL** | [Visit Action](${action_url}) |`,
''
].join('\n')
core.setOutput("comment", comment);
- name: 'Generate failure comment'
if: failure()
id: generate_failure_comment
uses: actions/github-script@ffc2c79a5b2490bd33e0a41c1de74b877714d736
with:
github-token: ${{ github.token }}
script: |
const action_url = "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"
const comment = [
'| Name | Result |',
'| :--- | :------ |',
`| **ROW Build status** | Failed ❌ |`,
`| **ROW Action URL** | [Visit Action](${action_url}) |`,
''
].join('\n')
core.setOutput("comment", comment);
- name: Post Cloudflare Pages Preview comment
if: success() || failure()
uses: marocchino/sticky-pull-request-comment@efaaab3fd41a9c3de579aba759d2552635e590fd
with:
header: Cloudflare Pages Preview Comment
number: ${{github.event.number}}
message: ${{steps.generate_preview_url.outputs.comment || steps.generate_failure_comment.outputs.comment }}
recreate: true

- name: Upload PR information to artifact
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2
with:
name: 'pr-${{github.run_id}}'
path: .pr
2 changes: 2 additions & 0 deletions .github/workflows/generate-preview-link.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,13 @@ jobs:
EVENT_NUMBER: ${{ github.event.number }}
EVENT_USERNAME: ${{ github.event.pull_request.user.login }}
HEAD_REF: ${{ github.head_ref }}
DRAFT: ${{ github.event.pull_request.draft }}
run: |
mkdir -p .pr
echo "$EVENT_NUMBER" > .pr/NR
echo "$EVENT_USERNAME" > .pr/USERNAME
echo "$HEAD_REF" > .pr/BRANCHNAME
echo "$DRAFT" > .pr/DRAFT
- name: Publish to Cloudflare Pages
id: publish-to-pages
Expand Down
Loading

0 comments on commit 7475754

Please sign in to comment.