Skip to content

Commit

Permalink
Merge pull request #55 from deriv-com/ako/change-DR-plan-to-vercel
Browse files Browse the repository at this point in the history
Ako/ Update DR solution
  • Loading branch information
ali-hosseini-deriv authored Jul 25, 2024
2 parents 46f4d45 + e57795b commit 1169978
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 22 deletions.
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
}
}

0 comments on commit 1169978

Please sign in to comment.