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

Ako/ Update DR solution #55

Merged
merged 43 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
899e93d
ci: add vercel upload action
ali-hosseini-deriv Jun 24, 2024
09b15aa
ci: add a temp gh workflow to test vercel upload action
ali-hosseini-deriv Jun 24, 2024
c3c9ff7
ci: rename the test workflow
ali-hosseini-deriv Jun 24, 2024
5a500ad
ci: use token instead of login
ali-hosseini-deriv Jun 24, 2024
ebf5a76
ci: add prebuilt flag to prevent vercel build
ali-hosseini-deriv Jun 24, 2024
81edf15
build: update vercel.json file
ali-hosseini-deriv Jun 24, 2024
d19c399
build: vercel build before publish
ali-hosseini-deriv Jun 24, 2024
dd96264
ci: pull vercel project before
ali-hosseini-deriv Jun 24, 2024
90bde89
ci: trigger workflow
ali-hosseini-deriv Jun 24, 2024
ac08379
ci: add token to build command
ali-hosseini-deriv Jun 24, 2024
2851d83
ci: use token from env
ali-hosseini-deriv Jun 24, 2024
823b179
ci: manually copy the built file to vercel dir
ali-hosseini-deriv Jun 24, 2024
d6c86ac
ci: add vercel secrets to build step
ali-hosseini-deriv Jun 24, 2024
90553bc
ci: add cwd dir
ali-hosseini-deriv Jun 24, 2024
267c1cc
ci: remove the build step
ali-hosseini-deriv Jun 25, 2024
f48e772
ci: use the build directory
ali-hosseini-deriv Jun 25, 2024
6c264ab
ci: add build step
ali-hosseini-deriv Jun 25, 2024
82190ae
ci: remove cwd flag
ali-hosseini-deriv Jun 25, 2024
6c31fde
ci: add vercel token
ali-hosseini-deriv Jun 25, 2024
ae3fca1
ci: add token to build step
ali-hosseini-deriv Jun 25, 2024
dab293b
trigger
ali-hosseini-deriv Jun 25, 2024
eb07316
ci: cat project.json file
ali-hosseini-deriv Jun 25, 2024
3d7ce76
ci: add scope
ali-hosseini-deriv Jun 25, 2024
b85138f
ci: copy build files manually
ali-hosseini-deriv Jun 25, 2024
c4b4b04
ci: use gh workflow static files
ali-hosseini-deriv Jun 25, 2024
2f770c0
ci: fix static not found error
ali-hosseini-deriv Jun 25, 2024
36eae26
build: add .vercel to gitignore
ali-hosseini-deriv Jun 26, 2024
40c5825
build: override vercel build and change the output dir
ali-hosseini-deriv Jun 26, 2024
a3b62a0
chore: to test the deployment
ali-hosseini-deriv Jun 26, 2024
da0ef24
chore: change alert to console
ali-hosseini-deriv Jun 26, 2024
3495cdc
fix: remove extra step to copy the files
ali-hosseini-deriv Jun 26, 2024
7c75f2b
ci: add preview env to staging step
ali-hosseini-deriv Jun 26, 2024
7d531e3
ci: remove unknown environment flag
ali-hosseini-deriv Jun 26, 2024
8425a3f
ci: test prod workflow
ali-hosseini-deriv Jun 26, 2024
0ae8ce7
ci: build for envs specifically
ali-hosseini-deriv Jun 26, 2024
996c5e8
feat: add binary.sx in official domains
ali-hosseini-deriv Jun 26, 2024
5900a6a
build: add DR vercel file
ali-hosseini-deriv Jul 9, 2024
4317a95
chore: test the DR in sample a workflow
ali-hosseini-deriv Jul 9, 2024
9f97f3c
ci: add vercel workflow for DR
ali-hosseini-deriv Jul 9, 2024
bf7292b
ci: add alias domain url
ali-hosseini-deriv Jul 9, 2024
e33c412
ci: remove the docker / k8s DR and fix the slack message
ali-hosseini-deriv Jul 23, 2024
b60c215
Merge branch 'master' of https://github.com/deriv-com/deriv-api-docs …
ali-hosseini-deriv Jul 23, 2024
e57795b
chore: discard unneeded changes
ali-hosseini-deriv Jul 23, 2024
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
31 changes: 11 additions & 20 deletions .github/workflows/release_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,28 +82,19 @@ jobs:
with:
name: build
path: build
- name: Publish to Docker
id: publish_to_docker
uses: ./.github/actions/publish_to_docker
- name: Upload to vercel
uses: 'deriv-com/shared-actions/.github/actions/vercel_DR_publish@master'
id: publish_to_vercel
with:
DOCKER_LATEST_IMAGE_TAG: 'latest'
DOCKER_IMAGE_TAG: ${{ github.ref_name }}
DOCKERHUB_ORGANISATION: ${{ secrets.DOCKERHUB_ORGANISATION }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Deploy to Kubernetes
id: deploy_to_kubernetes
uses: ./.github/actions/deploy_to_kubernetes
with:
K8S_VERSION: ${{ github.ref_name }}
K8S_NAMESPACE: 'deriv-com-api-production'
CA_CRT: ${{ secrets.CA_CRT }}
SERVICEACCOUNT_TOKEN: ${{ secrets.SERVICEACCOUNT_TOKEN }}
KUBE_SERVER: ${{ secrets.KUBE_SERVER }}
DOCKERHUB_ORGANISATION: ${{ secrets.DOCKERHUB_ORGANISATION }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_API_TOKEN }}
ENVIRONMENT: Production
VERCEL_SCOPE: deriv
ALIAS_DOMAIN_URL: 'api-docs-dr.binary.sx'
- name: Send Slack Notification
if: ${{ steps.publish_to_docker.outcome != 'success' || steps.deploy_to_kubernetes.outcome != 'success' }}
if: always() && ${{ steps.publish_to_vercel.outcome != 'success'}}
uses: ./.github/actions/notify_slack
with:
RELEASE_TYPE: ${{ env.RELEASE_TYPE }}
MESSAGE: "'${{ env.RELEASE_TYPE }}' Release succeeded for api.deriv.com with version *'${{ needs.build_and_publish.outputs.RELEASE_VERSION }}'* has Failed *"
MESSAGE: "Publish to vercel failed for '${{ env.RELEASE_TYPE }}' release on api.deriv.com with version *'${{ needs.build_and_publish.outputs.RELEASE_VERSION }}"
9 changes: 9 additions & 0 deletions .github/workflows/release_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,12 @@ jobs:
SERVICEACCOUNT_TOKEN: ${{ secrets.SERVICEACCOUNT_TOKEN }}
KUBE_SERVER: ${{ secrets.KUBE_SERVER }}
DOCKERHUB_ORGANISATION: ${{ secrets.DOCKERHUB_ORGANISATION }}
- name: Upload to vercel
uses: 'deriv-com/shared-actions/.github/actions/vercel_DR_publish@master'
with:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_API_TOKEN }}
ENVIRONMENT: Preview
VERCEL_SCOPE: deriv
ALIAS_DOMAIN_URL: 'staging-api-docs-dr.binary.sx'
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ yarn-error.log*

.idea

.vscode/settings.json
.vscode/settings.json
.vercel
2 changes: 2 additions & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export const domains = [
'staging-api.deriv.be',
'staging-api.deriv.me',
'staging-api.deriv.com',
'api.binary.sx',
'staging-api.binary.sx',
];

export const getCurrencyObject = (currency: string) => {
Expand Down
5 changes: 5 additions & 0 deletions vercel.dr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cleanUrls": true,
"outputDirectory": "build",
"buildCommand": "echo ✅ Skipping build to use existing built files"
}
2 changes: 1 addition & 1 deletion vercel.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"cleanUrls": true
}
}