Skip to content

Commit

Permalink
Merge branch 'master' into henry/DTRA-676/clean-up-smart-chart-remove…
Browse files Browse the repository at this point in the history
…-unused-files
  • Loading branch information
henry-deriv committed Jan 31, 2024
2 parents 88bd85d + fb0443d commit 151c01d
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 211 deletions.
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Configuration of code ownership and review approvals for the binary-com/deriv-app repo.
#
# More info: https://help.github.com/articles/about-codeowners/
#

* @deriv-com/admin-binary-static
32 changes: 16 additions & 16 deletions .github/actions/npm_install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ description: Install npm packages
runs:
using: composite
steps:
- name: restore_cache
uses: actions/cache@v3.3.2
with:
key: node-{{ checksum "package-lock.json" }}
path: UPDATE_ME
restore-keys: |-
node-{{ checksum "package-lock.json" }}
node-
- name: Install npm packages
run: npm ci
shell: bash
- name: save_cache
uses: actions/cache@v3.3.2
with:
path: node_modules
key: node-{{ checksum "package-lock.json" }}
- name: restore_cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
key: node-{{ checksum "package-lock.json" }}
path: UPDATE_ME
restore-keys: |-
node-{{ checksum "package-lock.json" }}
node-
- name: Install npm packages
run: npm ci
shell: bash
- name: save_cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: node_modules
key: node-{{ checksum "package-lock.json" }}
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
56 changes: 17 additions & 39 deletions .github/workflows/generate_preview_link.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
name: Generate preview link

permissions:
actions: write
checks: write
contents: write
deployments: write
pull-requests: write
statuses: write

on:
workflow_run:
workflows: ["Pre-generate preview link"]
types:
- completed
pull_request_target:
types: [opened, synchronize]

env:
HEAD_REF: ${{ github.head_ref }}
Expand All @@ -24,42 +14,30 @@ concurrency:
jobs:
build_and_deploy_preview_link:
runs-on: Ubuntu-latest
permissions:
checks: write
pull-requests: write
steps:
- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v2
- name: Verify user
uses: "deriv-com/shared-actions/.github/actions/verify_user_in_organization@v1"
with:
workflow_conclusion: success
run_id: ${{ github.event.workflow_run.id }}
name: "pr-${{ github.event.workflow_run.id }}"
path: .pr

- name: Retrieve pull request
id: pr_information
run: |
echo "username=$(cat .pr/USERNAME)" >> $GITHUB_OUTPUT
echo "issue_number=$(cat .pr/ISSUE_NUMBER)" >> $GITHUB_OUTPUT
username: ${{github.event.pull_request.user.login}}
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

- name: Post preview build comment
id: post_preview_build_comment
uses: "deriv-com/shared-actions/.github/actions/post_preview_build_comment@v1"
with:
issue_number: ${{steps.pr_information.outputs.issue_number}}
head_sha: ${{github.event.workflow_run.head_sha}}

- name: Verify user
uses: "deriv-com/shared-actions/.github/actions/verify_user_in_organization@v1"
with:
username: ${{steps.pr_information.outputs.username}}
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
issue_number: ${{github.event.number}}
head_sha: ${{github.event.pull_request.head.sha}}

- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
ref: ${{ github.event.workflow_run.head_sha }}
ref: ${{github.event.pull_request.head.sha}}

- name: Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e
with:
node-version: 12.22

Expand All @@ -80,7 +58,7 @@ jobs:
run: npm run test

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7
with:
node-version: 20

Expand All @@ -91,14 +69,14 @@ jobs:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_TEST_LINKS_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_TEST_LINKS_ACCOUNT_ID }}
project_name: "smarttrader-preview"
branch_name: "pr-${{steps.pr_information.outputs.issue_number}}"
branch_name: "pr-${{github.event.number}}"
output_dir: dist

- name: "Generate preview link comment"
uses: "deriv-com/shared-actions/.github/actions/post_preview_link_comment@v1"
if: always() && steps.post_preview_build_comment.outcome == 'success'
with:
issue_number: ${{steps.pr_information.outputs.issue_number}}
issue_number: ${{github.event.number}}
check_run_id: ${{steps.post_preview_build_comment.outputs.check_run_id}}
preview_url: ${{steps.publish_to_pages_branch.outputs.cf_pages_url}}
status: ${{job.status}}
34 changes: 0 additions & 34 deletions .github/workflows/pre_generate_preview_link.yml

This file was deleted.

112 changes: 56 additions & 56 deletions .github/workflows/release_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,67 @@ name: DSmartTrader Production Release
on:
push:
tags:
- production_*
- production_*
jobs:
build_and_test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install dependencies
uses: "./.github/actions/npm_install"
- name: Build
uses: "./.github/actions/build"
with:
target: production
- name: Versioning
uses: "./.github/actions/versioning"
with:
target_branch: production
- name: "Run Tests"
run: npm run test
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Setup Node
uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e
with:
node-version: 12
- name: Install dependencies
uses: "./.github/actions/npm_install"
- name: Build
uses: "./.github/actions/build"
with:
target: production
- name: Versioning
uses: "./.github/actions/versioning"
with:
target_branch: production
- name: "Run Tests"
run: npm run test
- name: Upload Artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: dist
path: dist
publish_cloudflare_production:
name: Publish to Cloudflare Production
runs-on: ubuntu-latest
needs: [build_and_test]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Download Artifacts
uses: actions/download-artifact@v3.0.2
with:
name: dist
path: dist
- name: Publish to Cloudflare
uses: "./.github/actions/publish_to_pages_production"
with:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- name: Build Docker image and push to Docker hub and K8S
uses: "./.github/actions/build_and_push_docker_image"
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_ORGANISATION: ${{ secrets.DOCKERHUB_ORGANISATION }}
K8S_NAMESPACE: smarttrader-deriv-app-production
KUBE_SERVER: ${{ secrets.KUBE_SERVER }}
SERVICEACCOUNT_TOKEN: ${{ secrets.SERVICEACCOUNT_TOKEN }}
CA_CRT: ${{ secrets.CA_CRT }}
APP_VERSION: latest
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Setup Node
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7
with:
node-version: 20
- name: Download Artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
name: dist
path: dist
- name: Publish to Cloudflare
uses: "./.github/actions/publish_to_pages_production"
with:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- name: Build Docker image and push to Docker hub and K8S
uses: "./.github/actions/build_and_push_docker_image"
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_ORGANISATION: ${{ secrets.DOCKERHUB_ORGANISATION }}
K8S_NAMESPACE: smarttrader-deriv-app-production
KUBE_SERVER: ${{ secrets.KUBE_SERVER }}
SERVICEACCOUNT_TOKEN: ${{ secrets.SERVICEACCOUNT_TOKEN }}
CA_CRT: ${{ secrets.CA_CRT }}
APP_VERSION: latest

notify_on_slack:
name: Notify on Slack
Expand All @@ -72,16 +72,16 @@ jobs:
needs: [publish_cloudflare_production, build_and_test]
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7
with:
node-version: 20
- name: Conclusion
uses: technote-space/workflow-conclusion-action@v3
uses: technote-space/workflow-conclusion-action@45ce8e0eb155657ab8ccf346ade734257fd196a5

- name: Download Artifacts
uses: actions/download-artifact@v3.0.2
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
name: dist
path: dist
Expand All @@ -93,5 +93,5 @@ jobs:
with:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
status: ${{ env.WORKFLOW_CONCLUSION }}
release_type: Production
release_type: Production
version: ${{ steps.extract_version.outputs.RELEASE_VERSION }}
Loading

0 comments on commit 151c01d

Please sign in to comment.