diff --git a/.github/workflows/staging-ci.yml b/.github/workflows/staging-ci.yml new file mode 100644 index 000000000..a52612006 --- /dev/null +++ b/.github/workflows/staging-ci.yml @@ -0,0 +1,57 @@ +name: deploy + +on: + push: + branches: + - development + +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_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_STAGING }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.PRIVATE_KEY }} + source: "dist" + target: "temp" + - name: Replace New Build + uses: appleboy/ssh-action@master + with: + 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 diff --git a/app/pods/components/blockers/upgrade/component.js b/app/pods/components/blockers/upgrade/component.js index dcc54e016..b5060eee0 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 c9110364a..23dc33be9 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