Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master origin #61

Open
wants to merge 153 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
5e43514
Revert "fix: replaced existing tnc document with updated version with…
prince-deriv May 26, 2022
c83fd86
Revert "Adrienne / Replaced youtube video in P2P landing page (#3000)…
prince-deriv May 26, 2022
f3d6458
MohammadH/ Fix iphone not showing number lists (#3087)
mohammad-hashemi-deriv May 26, 2022
ca1f17d
Update Meta Desc (#3096)
habib-deriv May 26, 2022
b607a70
Aswathy/unbolded the word (#3090)
aswathy-deriv May 26, 2022
3acdc95
chaks/enable_docker_image_validation (#2905)
shudarshon-deriv May 30, 2022
edc1f73
docs: updated deriv-investments-europe-limited.pdf (#3097)
vijayasree-deriv May 31, 2022
5ddca3c
fix: semantic html rules (#3083)
vijayasree-deriv May 31, 2022
46349b3
Meenu/feat: added turkish language switcher (#3063)
meenakshi-deriv Jun 1, 2022
6967f6a
Prince/ Translation poc (#3076)
prince-deriv Jun 1, 2022
390eb2c
fix: remove eu uk for the p2 banner (#3120)
habib-deriv Jun 1, 2022
ddd27be
Mohsen / updated PA page content (#3105)
mohsen-deriv Jun 2, 2022
ab92197
Mitra/fix: update links and change domain from .com to .eu (#3111)
mitra-deriv Jun 2, 2022
3c1754c
refactor: seo implementation for bug bounty (#3068)
meenakshi-deriv Jun 2, 2022
48e151b
fix: localize the text markets in homepage (#3084)
meenakshi-deriv Jun 2, 2022
6c38bf7
Revert "Mohsen / updated PA page content (#3105)" (#3123)
habib-deriv Jun 2, 2022
bde200e
Prince/Translation poc - update push and delete translation workflow …
prince-deriv Jun 2, 2022
f445326
Prince/Translation poc 3 (#3125)
prince-deriv Jun 2, 2022
cdd67a2
fiona / add 301 request to markets/forex page (#2656)
fiona-deriv Jun 3, 2022
b9ba666
Revert "fiona / add 301 request to markets/forex page (#2656)" (#3136)
habib-deriv Jun 3, 2022
f3b2461
fix: add 301 err on markets page (#3130)
pavel-latyshou-binary Jun 3, 2022
84e0f9e
Prince/ translations from the last process (#3108)
prince-deriv Jun 3, 2022
9a26bb0
Prince/ POC translation workflow (#3131)
prince-deriv Jun 3, 2022
681c46b
Update translation-push.yml (#3140)
prince-deriv Jun 3, 2022
70552d5
Update translation-push.yml (#3142)
prince-deriv Jun 3, 2022
18c5a47
Prince/ Translation poc workflow update (#3148)
prince-deriv Jun 3, 2022
12fa0f8
Update translation-push.yml (#3151)
prince-deriv Jun 3, 2022
5f24eb5
Update translation-push.yml (#3152)
prince-deriv Jun 3, 2022
d921aa7
Update translation-push.yml (#3155)
prince-deriv Jun 3, 2022
b3b3ee8
Update translation-push.yml (#3157)
prince-deriv Jun 3, 2022
df2ce79
Update translation-push.yml (#3158)
prince-deriv Jun 3, 2022
8c9598d
Update translation-push.yml (#3160)
prince-deriv Jun 3, 2022
5ea852c
NikitK/ Filter academy search results based on EU and UK (#3061)
NikitK-deriv Jun 3, 2022
e564910
Prince/Poc translation workflow (#3161)
prince-deriv Jun 4, 2022
65fa796
Update translation-push.yml (#3164)
prince-deriv Jun 5, 2022
239b8fe
Update translation-push.yml (#3166)
prince-deriv Jun 5, 2022
ce65407
Update translation-push.yml (#3167)
prince-deriv Jun 5, 2022
3796a64
Update translation-push.yml (#3168)
prince-deriv Jun 5, 2022
678b85a
Update translation-push.yml (#3169)
prince-deriv Jun 5, 2022
30d47ee
Prince/Branch manager (#3122)
prince-deriv Jun 5, 2022
58007d8
fix: fixed innerHtml trackjs issue (#3170)
mohsen-deriv Jun 6, 2022
9d12ea9
fix: us to uk flag (#3173)
pavel-latyshou-binary Jun 7, 2022
c158b9c
fix: turkey flag fix in dropdown (#3156)
meenakshi-deriv Jun 7, 2022
2a0e1ea
Mohsen / updated PA page design (#3127)
mohsen-deriv Jun 7, 2022
dfc211d
Update translation-push.yml (#3178)
prince-deriv Jun 8, 2022
439c811
MohammadH/ Academy hero banner issue (#3139)
mohammad-hashemi-deriv Jun 8, 2022
7c143ad
fix: fix height for language imgs (#3177)
pavel-latyshou-binary Jun 8, 2022
70c021e
fix: add space for deriv x in footer (#3135)
mitra-deriv Jun 8, 2022
2eec8c8
Meenu/feat: created tabs and organised location (#3107)
meenakshi-deriv Jun 8, 2022
9351d38
text: replaced the word authorized from regulatoy page (#3113)
meenakshi-deriv Jun 9, 2022
3775746
fix: fix overflow in safari (#3183)
mitra-deriv Jun 9, 2022
870c97e
style: added basket (#3103)
konstantinosG-deriv Jun 9, 2022
f1f0ce1
fix: fix the border radius issues for images in safari (#3186)
mitra-deriv Jun 9, 2022
89ea6a2
chore: unminify messages json for clear checking (#3190)
prince-deriv Jun 9, 2022
c9509a7
chore: this is to make sure that all strings going to master is extra…
prince-deriv Jun 10, 2022
d8e6f85
Prince/ update dropdown component to accept default value (#3196)
prince-deriv Jun 10, 2022
55a238b
Vijayasree/Translation 61623 basket indices (#3171)
vijayasree-deriv Jun 15, 2022
fcb8122
Vijayasree/feat: block eu.deriv.com domain for search engines (#3032)
vijayasree-deriv Jun 15, 2022
4f30bad
MohammadH/ useCountryRule hook (#3104)
mohammad-hashemi-deriv Jun 15, 2022
756b62d
Mitra/fix: add height to fit content (#3210)
mitra-deriv Jun 15, 2022
6e333f4
fix: fixed SEO bug in derivx (#3207)
mohsen-deriv Jun 15, 2022
b379924
fix: update api image (#3208)
mitra-deriv Jun 15, 2022
936bef8
Mitra/feat: add new section to bug bounty page (#3192)
mitra-deriv Jun 15, 2022
431611a
Mohsen / added webpack bundle analyzer (#3187)
mohsen-deriv Jun 15, 2022
6c83d6f
Meenu/fix: enable search with search icon (#3149)
meenakshi-deriv Jun 15, 2022
f848a4a
tib/chore: publish to Cloudflare (on push on master, on tag productio…
thibault-deriv Jun 16, 2022
41902bd
yashim/chore: retrigger deployment (#3220)
yashim-deriv Jun 16, 2022
cb92dcd
empty: trigger build (#3221)
mitra-deriv Jun 16, 2022
5a56308
yashim/chore: updated cache version (#3222)
yashim-deriv Jun 16, 2022
8c00bb5
yashim/chore: redeploy staging workflow (#3223)
yashim-deriv Jun 16, 2022
f935923
yashim/fix: dependency cache (#3224)
yashim-deriv Jun 16, 2022
5eefddd
tib/chore: setup node v3 with cache (#3225)
thibault-deriv Jun 16, 2022
5634b6e
yashim/fix: invalidate_cache (#3228)
yashim-deriv Jun 17, 2022
55f96af
yashim/chore: remove Gatsby build folder caching (#3230)
yashim-deriv Jun 17, 2022
5c54998
yashim/chore: retrigger staging deployment (#3231)
yashim-deriv Jun 17, 2022
3041379
yashim/chore: re-trigger deployment (#3232)
yashim-deriv Jun 17, 2022
892e834
Pavel/ Roadmap deriv-go section (#3198)
pavel-latyshou-binary Jun 17, 2022
07e31ae
Mohsen / removed gatsby markets redirect (#3214)
mohsen-deriv Jun 17, 2022
db72f04
fix: update the location for dubai (#3226)
mitra-deriv Jun 17, 2022
529db1d
Konstantinos / Removal of TER/USD, BTC/XAU & BTC/XAG - ROW domain (#3…
konstantinosG-deriv Jun 20, 2022
73faf04
fix: update bvi licence (#3194)
mitra-deriv Jun 20, 2022
0134e22
Meenu/fix: affilate bg changed (#3019)
meenakshi-deriv Jun 20, 2022
8ec9ca1
Mitra/fix: update image content in bug bounty page (#3235)
mitra-deriv Jun 20, 2022
061f211
MohammadH/ Individual page for each academy video (#3119)
mohammad-hashemi-deriv Jun 20, 2022
02504ba
MohammadH/ Disable redirection from eu.deriv.com to deriv.com (#3015)
mohammad-hashemi-deriv Jun 20, 2022
48478d0
Konstantinos/ To develop a new popup message to appear for Non EU IP …
konstantinosG-deriv Jun 20, 2022
666ef5c
chore: keep translate_text in oneline (#3203)
mohammad-hashemi-deriv Jun 20, 2022
cec409b
chore: fix wrong usage of function (#3244)
prince-deriv Jun 21, 2022
4efbe81
fix: academy layout not found issue (#3246)
mohammad-hashemi-deriv Jun 21, 2022
d6bd2ef
Revert "Konstantinos/ To develop a new popup message to appear for No…
habib-deriv Jun 24, 2022
0a6317c
Revert "MohammadH/ Disable redirection from eu.deriv.com to deriv.com…
ShuvoHabib Jun 24, 2022
ae8934a
chore: missing import (#3266)
prince-deriv Jun 24, 2022
443b643
Konstantinos / Security & Privacy T&Cs v. 4.2.1 - Adding DIEL securit…
konstantinosG-deriv Jun 28, 2022
2544ce3
Prince/ added utility redirection using a specific parameter (#3275)
prince-deriv Jun 28, 2022
f5d0115
Konstantinos / Any field that involves price shouldn't have character…
konstantinosG-deriv Jun 28, 2022
1e3b3df
Meenu/fix: added reddit and telegram icon in footer (#3238)
meenakshi-deriv Jun 28, 2022
1412443
fix: fix seo in deriv go and option pages (#3256)
mitra-deriv Jun 28, 2022
8533e03
fix: fixed menu drop down arrows (#3261)
mohsen-deriv Jun 28, 2022
17a9a6e
Who we are page | Locations, Cities, Countries Update NikitK / Task -…
NikitK-deriv Jun 28, 2022
db4c22b
chore: remove crypto_config dependency from website_status (#3117)
vijayasree-deriv Jun 28, 2022
4c38aed
Pavel/fix: expiry time (#3101)
pavel-latyshou-binary Jun 28, 2022
5ee8128
fix: fixed deriv footer logo alignment (#3251)
mohsen-deriv Jun 28, 2022
373674d
chore: reorganized deps and dev deps (#3185)
mohsen-deriv Jun 28, 2022
1e4420a
Pavel/67717 p2p roadmap (#3234)
pavel-latyshou-binary Jun 29, 2022
e1d215a
fix: seo for deriv go page (#3257)
meenakshi-deriv Jun 29, 2022
dd924b5
fix: lint issue (#3281)
habib-deriv Jun 29, 2022
ec2b236
Publish to cloudflare when releasing academy content (#3269)
thibault-deriv Jun 30, 2022
31e117d
MohammadH/ Fix eu infinite websocket and eu pop-up message (#3253)
mohammad-hashemi-deriv Jul 1, 2022
a4ca1f9
style: fix video title jump in academy individual video page (#3278)
mohammad-hashemi-deriv Jul 1, 2022
e28f565
fix: ebook color (#3255)
behnaz-deriv Jul 3, 2022
03ba7a8
Meenu/feat: added p2p home banner (#3290)
meenakshi-deriv Jul 4, 2022
887d0d4
fix: fix p2p page in eu domain (#3287)
mohsen-deriv Jul 4, 2022
196b48a
MohammadH/ Fix signup button in hero doesn't work in eu staging (#3297)
mohammad-hashemi-deriv Jul 6, 2022
a4b73e2
MohammadH/ Disable markets fold auto scroll on uk ip (#3299)
mohammad-hashemi-deriv Jul 6, 2022
cfc09ca
fix: unextracted string from help center (#3305)
vijayasree-deriv Jul 6, 2022
15f891c
chore: quick copy paste for later update
prince-deriv Jul 6, 2022
415e509
chore: temp
prince-deriv Jul 6, 2022
85257d1
empty: remove failing caching (#3312)
thibault-deriv Jul 7, 2022
5bb2384
text: update cfd % (#3302)
vijayasree-deriv Jul 12, 2022
c499c28
feat: add michio to codeowners (#3317)
yashim-deriv Jul 12, 2022
cedd701
fix: add sort to show the weekly post which doesn't show up in produc…
mohammad-hashemi-deriv Jul 12, 2022
9a47cc5
Meenu/ fix: increased cta button size (#3274)
meenakshi-deriv Jul 13, 2022
bf5a9da
Mohsen / Update deriv-react with master (#3248)
mohsen-deriv Jul 13, 2022
d3850d9
Mitra/fix: fix the icons alignment (#3218)
mitra-deriv Jul 13, 2022
cf79e8e
chore: remove antony without updating graphql file (#3308)
konstantinosG-deriv Jul 13, 2022
0ec56d9
Meenu/ fix: fixed language changes on cfd and multiplier pages (#3283)
meenakshi-deriv Jul 13, 2022
418a53c
refactor: remove all unused variables (#3307)
alamin-deriv Jul 13, 2022
c555a1e
docs: updated DFX Supplementary (#3267)
alamin-deriv Jul 13, 2022
907f194
Konstantinos / add qr code for all deriv apps (#3242)
konstantinosG-deriv Jul 13, 2022
684b15c
Merge pull request #62 from prince-deriv/pr-69561-poc-translation-aut…
prince-deriv Jul 13, 2022
b041ed9
chore: missing api key
prince-deriv Jul 13, 2022
63aba2a
Merge pull request #63 from prince-deriv/pr-69561-poc-translation-aut…
prince-deriv Jul 13, 2022
ac1550b
chore: missing api key
prince-deriv Jul 13, 2022
e265f0e
Merge pull request #64 from prince-deriv/pr-69561-poc-translation-aut…
prince-deriv Jul 13, 2022
e660070
chore: adjust git commands
prince-deriv Jul 13, 2022
4b2bf51
Merge pull request #65 from prince-deriv/pr-69561-poc-translation-aut…
prince-deriv Jul 13, 2022
4603840
chore: adjust git commands
prince-deriv Jul 13, 2022
c8126f1
Merge pull request #66 from prince-deriv/pr-69561-poc-translation-aut…
prince-deriv Jul 13, 2022
641a8d4
chore: adjust git commands
prince-deriv Jul 13, 2022
04e258b
Merge pull request #67 from prince-deriv/pr-69561-poc-translation-aut…
prince-deriv Jul 13, 2022
df245c2
chore: adjust git commands
prince-deriv Jul 13, 2022
068043c
Merge pull request #68 from prince-deriv/pr-69561-poc-translation-aut…
prince-deriv Jul 13, 2022
635acae
chore: adjust git commands
prince-deriv Jul 13, 2022
8a1b9f0
Merge pull request #69 from prince-deriv/pr-69561-poc-translation-aut…
prince-deriv Jul 13, 2022
93d8424
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
prince-deriv Jul 13, 2022
8a51131
chore: adjust git commands
prince-deriv Jul 13, 2022
02de417
Merge branch 'master-origin' into pr-69561-poc-translation-auto-pr
prince-deriv Jul 13, 2022
df7d0c5
Merge pull request #70 from prince-deriv/pr-69561-poc-translation-aut…
prince-deriv Jul 13, 2022
764a56f
chore: adjust git commands
prince-deriv Jul 13, 2022
7a2d409
chore: adjust git commands
prince-deriv Jul 13, 2022
73436c8
Merge pull request #72 from prince-deriv/pr-69561-poc-translation-aut…
prince-deriv Jul 13, 2022
b54aefd
chore: adjust git commands
prince-deriv Jul 13, 2022
33cc07e
Merge pull request #73 from prince-deriv/pr-69561-poc-translation-aut…
prince-deriv Jul 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"eslint:recommended",
"plugin:react/recommended",
"plugin:import/errors",
"plugin:import/warnings"
"plugin:import/warnings",
"plugin:react-hooks/recommended"
],
"overrides": [
{
Expand Down Expand Up @@ -32,6 +33,8 @@
"strict": 0,
"camelcase": 0,
"no-console": "warn",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"no-trailing-spaces": [
"error",
{
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
# (in case no pattern matches a path in a PR - this should be treated as a bug and result in adding the path to CODEOWNERS)
# ==============================================================

* @habib-deriv @prince-deriv
* @habib-deriv @prince-deriv @michio-rework



Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,6 @@ jobs:
- name: Set version env variable
run: echo "GATSBY_DERIV_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ secrets.CACHE_VERSION }}

- name: Cache Gatsby
id: gatsby-cache-build
uses: actions/cache@v2
Expand Down Expand Up @@ -126,6 +118,16 @@ jobs:
echo ${{ secrets.CA_CRT}} | base64 --decode > ca.crt
./release.sh deriv-com ${{ steps.get_tag_name.outputs.VERSION }}

- name: Deploy to Cloudflare ☁️
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages publish public --project-name=deriv-com-pages --branch=main

- name: Cloudflare production link ✨
run: echo "New website - http://cf-pages-deriv-com.deriv.com"

- name: Slack Notification 📣
uses: 8398a7/action-slack@v3
with:
Expand Down
36 changes: 17 additions & 19 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,11 @@ jobs:
uses: actions/[email protected]

- name: Set up Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 14
- name: Cache dependencies
id: cache
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}
cache: 'npm'

- name: Install Node.js dependencies
run: |
npm ci
Expand All @@ -50,21 +44,14 @@ jobs:
uses: actions/[email protected]

- name: Setup Node
uses: actions/setup-node@v2.1.2
uses: actions/setup-node@v3
with:
node-version: '14.x'
cache: 'npm'

- name: Set version env variable
run: echo "GATSBY_DERIV_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ secrets.CACHE_VERSION }}

- name: Cache Gatsby
id: gatsby-cache-build
uses: actions/cache@v2
Expand Down Expand Up @@ -97,7 +84,8 @@ jobs:
- name: Verify nginx image
run: |
set -e
#docker run --rm -it --entrypoint sh ${{ secrets.DOCKHUB_ORGANISATION }}/deriv-com:latest -c "nginx -t"
docker run --rm ${{ secrets.DOCKHUB_ORGANISATION }}/deriv-com:$GIT_TAG_NAME nginx -t
echo "docker image validated successfully"

- name: Pushing Image to docker hub 🐳
run: |
Expand All @@ -117,6 +105,16 @@ jobs:
echo ${{ secrets.CA_CRT}} | base64 --decode > ca.crt
./release.sh deriv-com $GIT_TAG_NAME

- name: Deploy to Cloudflare ☁️
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages publish public --project-name=deriv-com-pages --branch=main

- name: Cloudflare production link ✨
run: echo "New website - http://cf-pages-deriv-com.deriv.com"

- name: Slack Notification 📣
uses: 8398a7/action-slack@v3
with:
Expand Down
233 changes: 110 additions & 123 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
@@ -1,132 +1,119 @@
name: Release Staging

on:
push:
branches:
- master
paths-ignore:
- '**.md'
push:
branches:
- master
paths-ignore:
- "**.md"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
GATSBY_CPU_COUNT: 2
GATSBY_ENV: staging
DIRECTUS_AUTH_TOKEN: ${{ secrets.DIRECTUS_AUTH_TOKEN }}
GATSBY_DIRECTUS_AUTH_TOKEN: ${{ secrets.GATSBY_DIRECTUS_AUTH_TOKEN }}
GATSBY_ENV_CIO_SITE_ID: ${{ secrets.GATSBY_ENV_CIO_SITE_ID }}
GATSBY_CPU_COUNT: 2
GATSBY_ENV: staging
DIRECTUS_AUTH_TOKEN: ${{ secrets.DIRECTUS_AUTH_TOKEN }}
GATSBY_DIRECTUS_AUTH_TOKEN: ${{ secrets.GATSBY_DIRECTUS_AUTH_TOKEN }}
GATSBY_ENV_CIO_SITE_ID: ${{ secrets.GATSBY_ENV_CIO_SITE_ID }}

jobs:
lint:
timeout-minutes: 10
runs-on: ubuntu-latest
environment: staging

steps:
- name: Checkout 🛎️
uses: actions/[email protected]

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 14
- name: Cache dependencies
id: cache
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}
- name: Install Node.js dependencies
run: |
npm ci
npm test

release-staging:
needs: lint
timeout-minutes: 30
runs-on: ubuntu-latest
environment: staging
steps:
- name: Checkout 🛎️
uses: actions/[email protected]

- name: Setup Node
uses: actions/[email protected]
with:
node-version: '14.x'

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ secrets.CACHE_VERSION }}

- name: Cache Gatsby
id: gatsby-cache-build
uses: actions/cache@v2
with:
path: |
public
.cache
key: ${{ runner.os }}-gatsby-build-${{ secrets.CACHE_VERSION }}-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-gatsby-build-${{ secrets.CACHE_VERSION }}

- run: npm ci
- run: npm run format
- run: npm run test
- run: npm run build
- run: npm run build:storybook
- uses: olegtarasov/[email protected]
id: tagName
# For using same tag for staging and production we need to uncomment these two below lines:
# with:
# tagRegex: "staging(.*)"
- name: Building docker image 🐳
run: docker build -t ${{ secrets.DOCKHUB_ORGANISATION }}/deriv-com:latest-staging -t ${{ secrets.DOCKHUB_ORGANISATION }}/deriv-com:$GITHUB_SHA .

- name: Verify nginx image
run: |
set -e
#docker run --rm -it --entrypoint sh ${{ secrets.DOCKHUB_ORGANISATION }}/deriv-com:latest-staging -c "nginx -t"

- name: Pushing Image to docker hub 🐳
run: |
echo ${{ secrets.DOCKERHUB_PASSWORD }}| docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
docker push ${{ secrets.DOCKHUB_ORGANISATION }}/deriv-com:latest-staging
docker push ${{ secrets.DOCKHUB_ORGANISATION }}/deriv-com:$GITHUB_SHA

- name: Deploy 🚀
run: |
export NAMESPACE="deriv-com-staging"
export SERVICEACCOUNT_TOKEN=${{ secrets.SERVICEACCOUNT_TOKEN }}
export DOCKERHUB_ORGANISATION=${{ secrets.DOCKERHUB_ORGANISATION }}
export KUBE_SERVER=${{ secrets.KUBE_SERVER }}
export CA=${{ secrets.CA }}
git clone https://github.com/binary-com/devops-ci-scripts
cd devops-ci-scripts/k8s-build_tools
echo ${{ secrets.CA_CRT}} | base64 --decode > ca.crt
./release.sh deriv-com $GITHUB_SHA

- name: Slack Notification 📣
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: workflow,repo
if_mention: failure,cancelled
custom_payload: |
{
attachments: [{
color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning',
text: `Release for *Deriv.com* with version *$GITHUB_SHA*`
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
if: always()
lint:
timeout-minutes: 10
runs-on: ubuntu-latest
environment: staging

steps:
- name: Checkout 🛎️
uses: actions/[email protected]

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 14
cache: "npm"

- name: Install Node.js dependencies
run: |
npm ci
npm test

release-staging:
needs: lint
timeout-minutes: 30
runs-on: ubuntu-latest
environment: staging
steps:
- name: Checkout 🛎️
uses: actions/[email protected]

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "14.x"
cache: "npm"

- run: npm ci
- run: npm run format
- run: npm run test
- run: npm run build
- run: npm run build:storybook
- uses: olegtarasov/[email protected]
id: tagName
# For using same tag for staging and production we need to uncomment these two below lines:
# with:
# tagRegex: "staging(.*)"
- name: Building docker image 🐳
run: docker build -t ${{ secrets.DOCKHUB_ORGANISATION }}/deriv-com:latest-staging -t ${{ secrets.DOCKHUB_ORGANISATION }}/deriv-com:$GITHUB_SHA .

- name: Verify nginx image
run: |
set -e
docker run --rm ${{ secrets.DOCKHUB_ORGANISATION }}/deriv-com:$GITHUB_SHA nginx -t
echo "docker image validated successfully"

- name: Pushing Image to docker hub 🐳
run: |
echo ${{ secrets.DOCKERHUB_PASSWORD }}| docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
docker push ${{ secrets.DOCKHUB_ORGANISATION }}/deriv-com:latest-staging
docker push ${{ secrets.DOCKHUB_ORGANISATION }}/deriv-com:$GITHUB_SHA

- name: Deploy 🚀
run: |
export NAMESPACE="deriv-com-staging"
export SERVICEACCOUNT_TOKEN=${{ secrets.SERVICEACCOUNT_TOKEN }}
export DOCKERHUB_ORGANISATION=${{ secrets.DOCKERHUB_ORGANISATION }}
export KUBE_SERVER=${{ secrets.KUBE_SERVER }}
export CA=${{ secrets.CA }}
git clone https://github.com/binary-com/devops-ci-scripts
cd devops-ci-scripts/k8s-build_tools
echo ${{ secrets.CA_CRT}} | base64 --decode > ca.crt
./release.sh deriv-com $GITHUB_SHA

- name: Deploy to Cloudflare ☁️
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages publish public --project-name=deriv-com-pages --branch=staging

- name: Cloudflare preview link ✨
run: echo "New staging website - http://staging.cf-pages-deriv-com.deriv.com"

- name: Slack Notification 📣
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: workflow,repo
if_mention: failure,cancelled
custom_payload: |
{
attachments: [{
color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning',
text: `Release for *Deriv.com* with version *$GITHUB_SHA*`
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
if: always()
Loading