From 32c5deed5858d58de7a18de903c14dca966257c0 Mon Sep 17 00:00:00 2001 From: Vibhu Dujari Date: Fri, 7 May 2021 16:10:52 +0530 Subject: [PATCH 1/3] ci for staging --- .github/workflows/staging-ci.yml | 57 ++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/staging-ci.yml diff --git a/.github/workflows/staging-ci.yml b/.github/workflows/staging-ci.yml new file mode 100644 index 00000000..0d19f526 --- /dev/null +++ b/.github/workflows/staging-ci.yml @@ -0,0 +1,57 @@ +name: deploy + +on: + push: + branches: + - master + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v1 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Read .nvmrc + run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)" + id: nvm + - name: Use Node.js (.nvmrc) + uses: actions/setup-node@v1 + with: + node-version: "${{ steps.nvm.outputs.NVMRC }}" + - name: Installing Dependencies + run: yarn install + - name: Build + run: yarn build --env staging + - name: Create temp Directory + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.HOST_PRODUCTION }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.PRIVATE_KEY }} + script: mkdir -p ~/temp && rm -rf ~/temp/* + - name: Upload Build + uses: appleboy/scp-action@master + with: + host: ${{ secrets.HOST_PRODUCTION }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.PRIVATE_KEY }} + source: "dist" + target: "temp" + - name: Replace New Build + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.HOST_PRODUCTION }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.PRIVATE_KEY }} + script: rm -rf ~/frontends/codingblocks.online.projectx/* && cp -rf ~/temp/dist/* ~/frontends/codingblocks.online.projectx/ && rm -rf ~/temp \ No newline at end of file From 112f5d0abc99ec88c1f69cb8eb8995095bd5dfed Mon Sep 17 00:00:00 2001 From: Vibhu Dujari Date: Wed, 16 Jun 2021 15:02:42 +0530 Subject: [PATCH 2/3] fix: upgradePack redirect to buy if attempt!= premium --- app/pods/components/blockers/upgrade/component.js | 10 +++++++++- app/pods/components/blockers/upgrade/template.hbs | 9 ++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/pods/components/blockers/upgrade/component.js b/app/pods/components/blockers/upgrade/component.js index dcc54e01..b5060eee 100644 --- a/app/pods/components/blockers/upgrade/component.js +++ b/app/pods/components/blockers/upgrade/component.js @@ -2,7 +2,7 @@ import Component from '@ember/component'; import { dropTask } from 'ember-concurrency-decorators'; import { timeout } from 'ember-concurrency'; import { inject as service } from '@ember/service'; -import { computed } from '@ember/object'; +import { action, computed } from '@ember/object'; import config from 'codingblocks-online/config/environment'; @@ -37,4 +37,12 @@ export default class UpgradeBlocker extends Component { } return `${config.dukaanUrl}/buy?` + $.param(params) } + + @action + log(event, course){ + this.metrics.trackEvent({ + action: event, + category: course, + }) + } } \ No newline at end of file diff --git a/app/pods/components/blockers/upgrade/template.hbs b/app/pods/components/blockers/upgrade/template.hbs index c9110364..23dc33be 100644 --- a/app/pods/components/blockers/upgrade/template.hbs +++ b/app/pods/components/blockers/upgrade/template.hbs @@ -70,7 +70,14 @@ {{!--
30% Discount
--}} - Upgrade + {{#if runAttempt.premimum}} + Upgrade + {{else}} + + Buy Now to Upgrade + + {{/if}} {{else}}
No Upgrade Packs available. Please contact support@codingblocks.com From 0247225981b37a6571ecbed23c4ecb7de16d7b19 Mon Sep 17 00:00:00 2001 From: Vibhu Dujari Date: Wed, 16 Jun 2021 15:12:08 +0530 Subject: [PATCH 3/3] replace: HOST_PRODUCTION -> HOST_STAGING --- .github/workflows/staging-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/staging-ci.yml b/.github/workflows/staging-ci.yml index 0d19f526..a5261200 100644 --- a/.github/workflows/staging-ci.yml +++ b/.github/workflows/staging-ci.yml @@ -3,7 +3,7 @@ name: deploy on: push: branches: - - master + - development jobs: deploy: @@ -36,14 +36,14 @@ jobs: - name: Create temp Directory uses: appleboy/ssh-action@master with: - host: ${{ secrets.HOST_PRODUCTION }} + host: ${{ secrets.HOST_STAGING }} username: ${{ secrets.USERNAME }} key: ${{ secrets.PRIVATE_KEY }} script: mkdir -p ~/temp && rm -rf ~/temp/* - name: Upload Build uses: appleboy/scp-action@master with: - host: ${{ secrets.HOST_PRODUCTION }} + host: ${{ secrets.HOST_STAGING }} username: ${{ secrets.USERNAME }} key: ${{ secrets.PRIVATE_KEY }} source: "dist" @@ -51,7 +51,7 @@ jobs: - name: Replace New Build uses: appleboy/ssh-action@master with: - host: ${{ secrets.HOST_PRODUCTION }} + host: ${{ secrets.HOST_STAGING }} username: ${{ secrets.USERNAME }} key: ${{ secrets.PRIVATE_KEY }} script: rm -rf ~/frontends/codingblocks.online.projectx/* && cp -rf ~/temp/dist/* ~/frontends/codingblocks.online.projectx/ && rm -rf ~/temp \ No newline at end of file