Skip to content

Commit

Permalink
Feature/deployment adjustments (#4041)
Browse files Browse the repository at this point in the history
Workflow to deploy nightly to Akamai CDN
  • Loading branch information
dsilhavy authored Sep 14, 2022
1 parent e6b71ea commit 1e0efe0
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 4 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: deploy

on:
workflow_call:
inputs:
envname:
required: true
type: string
deploy_path:
required: true
type: string
secrets:
host:
required: true
user:
required: true
private_key:
required: true

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "14.x"
- name: Install dependencies
run: npm install
- name: Run build
run: npm run build
- name: Find and Replace
uses: jacobtomlinson/gha-find-replace@v2
env:
replacement_string: ${{ format('{0} - commit <a href="https://github.com/Dash-Industry-Forum/dash.js/commit/{1}">{2}</a>', github.ref_name, github.sha, github.sha)}}
with:
find: "<!-- commit-info -->"
replace: ${{env.replacement_string}}
include: "samples/dash-if-reference-player/index.html"
- name: Copy to deploy directory for deployment
run: |
mkdir ${{inputs.envname}}
cp -R contrib dist samples test/functional/config test/functional/tests ${{inputs.envname}}
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.private_key }}
known_hosts: unnecessary

- name: Deploy with rsync
run: rsync -av -e "ssh -o StrictHostKeyChecking=no -oHostKeyAlgorithms=+ssh-dss" ${{inputs.envname}} ${{ secrets.user }}@${{ secrets.host }}:${{ inputs.deploy_path }}
17 changes: 17 additions & 0 deletions .github/workflows/deploy_latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: deploy

on:
push:
branches:
- 'master'

jobs:
deploy_staging:
uses: ./.github/workflows/deploy.yml
with:
envname: latest
deploy_path: '/377335/dash.js'
secrets:
host: ${{secrets.HOST}}
user: ${{secrets.USER}}
private_key: ${{secrets.PRIVATE_KEY}}
17 changes: 17 additions & 0 deletions .github/workflows/deploy_nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: deploy

on:
push:
branches:
- 'development'

jobs:
deploy_staging:
uses: ./.github/workflows/deploy.yml
with:
envname: nightly
deploy_path: '/377335/dash.js'
secrets:
host: ${{secrets.HOST}}
user: ${{secrets.USER}}
private_key: ${{secrets.PRIVATE_KEY}}
8 changes: 4 additions & 4 deletions src/dash/controllers/ContentSteeringController.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function ContentSteeringController() {
}

function loadSteeringData() {
return new Promise((resolve, reject) => {
return new Promise((resolve) => {
try {
const steeringDataFromManifest = getSteeringDataFromManifest();
if (!steeringDataFromManifest || !steeringDataFromManifest.serverUrl) {
Expand All @@ -158,11 +158,11 @@ function ContentSteeringController() {
},
error: (e) => {
_handleSteeringResponseError(e);
reject(e);
resolve(e);
}
});
} catch (e) {
reject(e);
resolve(e);
}
})
}
Expand Down Expand Up @@ -232,7 +232,7 @@ function ContentSteeringController() {

function _startSteeringRequestTimer() {
// Start timer for next request
if (currentSteeringResponseData.ttl && !isNaN(currentSteeringResponseData.ttl)) {
if (currentSteeringResponseData && currentSteeringResponseData.ttl && !isNaN(currentSteeringResponseData.ttl)) {
if (nextRequestTimer) {
clearTimeout(nextRequestTimer);
}
Expand Down

0 comments on commit 1e0efe0

Please sign in to comment.