Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from netlify to CloudFlare Pages #5305

Merged
merged 5 commits into from
Mar 17, 2023
Merged
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
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ body:
options:
- label: The issue observed is not already reported by searching on Github under https://github.com/video-dev/hls.js/issues
required: true
- label: The issue occurs in the stable client (latest release) on https://hls-js.netlify.com/demo and not just on my page
- label: The issue occurs in the stable client (latest release) on https://hlsjs.pages.dev/demo and not just on my page
required: true
- label: The issue occurs in the latest client (main branch) on https://hls-js-dev.netlify.com/demo and not just on my page
- label: The issue occurs in the latest client (main branch) on https://hlsjs-dev.pages.dev/demo and not just on my page
required: true
- label: The stream has correct Access-Control-Allow-Origin headers (CORS)
required: true
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ jobs:
env:
CI: true

netlify:
cloudflare:
needs: [config, test_unit]
if: needs.config.outputs.tag || needs.config.outputs.isMainBranch == 'true'
runs-on: ubuntu-latest
Expand Down Expand Up @@ -197,19 +197,19 @@ jobs:
env:
CI: true

- name: build netlify
- name: build for CloudFlare
run: |
./scripts/build-netlify.sh
./scripts/build-cloudflare.sh
env:
CI: true

- name: deploy netlify
- name: deploy to CloudFlare
run: |
./scripts/deploy-netlify.sh
./scripts/deploy-cloudflare.sh
env:
CI: true
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
NETLIFY_ACCESS_TOKEN: ${{ secrets.NETLIFY_ACCESS_TOKEN }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

update_draft_release:
needs: [config, test_unit]
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ coverage/
/lib
/dist
/dist.zip
/netlify
/cloudflare-pages
/api-docs
/api-docs-markdown

Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,27 +269,25 @@ An overview of this project's design, it's modules, events, and error handling c
## API docs and usage guide

- [API and usage docs, with code examples](./docs/API.md)
- [Auto-Generated API Docs (Latest Release)](https://hls-js.netlify.com/api-docs)
- [Auto-Generated API Docs (Development Branch)](https://hls-js-dev.netlify.com/api-docs)
- [Auto-Generated API Docs (Latest Release)](https://hlsjs.pages.dev/api-docs)
- [Auto-Generated API Docs (Development Branch)](https://hlsjs-dev.pages.dev/api-docs)

_Note you can access the docs for a particular version using "[https://github.com/video-dev/hls.js/tree/deployments](https://github.com/video-dev/hls.js/tree/deployments)"_

## Demo

### Latest Release

[https://hls-js.netlify.com/demo](https://hls-js.netlify.com/demo)
[https://hlsjs.pages.dev/demo](https://hlsjs.pages.dev/demo)

### Master

[https://hls-js-dev.netlify.com/demo](https://hls-js-dev.netlify.com/demo)
[https://hlsjs-dev.pages.dev/demo](https://hlsjs-dev.pages.dev/demo)

### Specific Version

Find the commit on [https://github.com/video-dev/hls.js/tree/deployments](https://github.com/video-dev/hls.js/tree/deployments).

[![](https://www.netlify.com/img/global/badges/netlify-color-accent.svg)](https://www.netlify.com)

[![](https://opensource.saucelabs.com/images/opensauce/powered-by-saucelabs-badge-gray.png?sanitize=true)](https://saucelabs.com)

## Compatibility
Expand Down
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1>
<h2 class="title">demo</h2>

<h3>
<a href="../api-docs">API docs | usage guide</a>
<a href="../api-docs/">API docs | usage guide</a>
</h3>
</header>
</div>
Expand Down
30 changes: 14 additions & 16 deletions demo/main.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* global $, Hls, __NETLIFY__ */
/* global $, Hls, __CLOUDFLARE_PAGES__ */
/* eslint camelcase: 0 */

import { pack } from 'jsonpack';
import 'promise-polyfill/src/polyfill';
import { sortObject, copyTextToClipboard } from './demo-utils';
import { TimelineChart } from './chart/timeline-chart';

const NETLIFY = __NETLIFY__; // replaced in build
const CLOUDFLARE_PAGES = __CLOUDFLARE_PAGES__; // replaced in build

const STORAGE_KEYS = {
Editor_Persistence: 'hlsjs:config-editor-persist',
Expand Down Expand Up @@ -175,26 +175,24 @@ $(document).ready(function () {
$('#dumpfMP4').prop('checked', dumpfMP4);
$('#levelCapping').val(levelCapping);

// link to version on npm if canary
// github branch for a branch version
// github tag for a normal tag
// github PR for a pr
// If cloudflare pages build link to branch
// If not a stable tag link to npm
// otherwise link to github tag
function getVersionLink(version) {
const alphaRegex = /[-.]0\.alpha\./;
if (alphaRegex.test(version)) {
const noneStable = version.includes('-');
if (CLOUDFLARE_PAGES) {
return `https://github.com/video-dev/hls.js/tree/${encodeURIComponent(
CLOUDFLARE_PAGES.branch
)}`;
} else if (noneStable) {
return `https://www.npmjs.com/package/hls.js/v/${encodeURIComponent(
version
)}`;
} else if (NETLIFY.reviewID) {
return `https://github.com/video-dev/hls.js/pull/${NETLIFY.reviewID}`;
} else if (NETLIFY.branch) {
return `https://github.com/video-dev/hls.js/tree/${encodeURIComponent(
NETLIFY.branch
} else {
return `https://github.com/video-dev/hls.js/releases/tag/v${encodeURIComponent(
version
)}`;
}
return `https://github.com/video-dev/hls.js/releases/tag/v${encodeURIComponent(
version
)}`;
}

const version = Hls.version;
Expand Down
2 changes: 1 addition & 1 deletion docs/API.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# HLS.js v1 API

See [API Reference](https://hls-js-dev.netlify.app/api-docs/) for a complete list of interfaces available in the hls.js package.
See [API Reference](https://hlsjs-dev.pages.dev/api-docs/) for a complete list of interfaces available in the hls.js package.

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
Expand Down
8 changes: 0 additions & 8 deletions netlify.toml

This file was deleted.

Loading