Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
57 changes: 57 additions & 0 deletions .github/workflows/staging-ci.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 9 additions & 1 deletion app/pods/components/blockers/upgrade/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';


Expand Down Expand Up @@ -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,
})
}
}
9 changes: 8 additions & 1 deletion app/pods/components/blockers/upgrade/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,14 @@
</div>
{{!-- <div class="gradient-text-orange mt-1">30% Discount</div> --}}
</div>
<a href={{buyLink}} target="_blank" class="button-solid button-orange">Upgrade</a>
{{#if runAttempt.premimum}}
<a href={{buyLink}} target="_blank" class="button-solid button-orange">Upgrade</a>
{{else}}
<a href="/courses/{{runAttempt.run.course.identifier}}" class="button-solid button-orange mr-4"
onclick={{action 'log' 'buy_now' runAttempt.run.course.identifier preventDefault=false}}>
Buy Now to Upgrade
</a>
{{/if}}
{{else}}
<div class="col-12 t-align-c">
No Upgrade Packs available. Please contact <a href="mailto:[email protected]">[email protected]</a>
Expand Down