Skip to content

Instantly share code, notes, and snippets.

@Maikon
Forked from cvan/HOWTO.md
Created February 7, 2019 08:46
Show Gist options
  • Save Maikon/cffcb40b8d5578230fb9a3abcb0fca58 to your computer and use it in GitHub Desktop.
Save Maikon/cffcb40b8d5578230fb9a3abcb0fca58 to your computer and use it in GitHub Desktop.

Revisions

  1. @cvan cvan revised this gist Sep 23, 2016. 1 changed file with 12 additions and 10 deletions.
    22 changes: 12 additions & 10 deletions HOWTO.md
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,13 @@
    # Workflow
    # Instructions

    1. Make sure you have registered your domain.
    2. Sign up for CloudFlare and create an account for that domain.
    3. In your domain registrar's admin panel, point the nameservers to CloudFlare's.
    4. From the CloudFlare settings for that domain, enable SSL and set up a [Page Rule to force HTTPS redirects](https://support.cloudflare.com/hc/en-us/articles/200168306-Is-there-a-tutorial-for-Page-Rules-). (If you want to get fancy, you can also enable automatic minification, which is a pretty cool feature if you don't want/have a build step for that.)
    5. On GitHub create a new repository to store all the site (preferably in the form of static web pages and assets, though for the A-Frame site we use something called Hexo - not necessary though, YMMV).
    6. Create a CNAME record to point aframe.io to aframevr.github.io. (See https://help.github.com/articles/tips-for-configuring-a-cname-record-with-your-dns-provider/.)
    7. In your repo, create a file called `CNAME` containing the domain name (e.g., `aframe.io`).
    8. Push to GitHub Pages (either by pushing to `gh-pages` of some ordinary repo; or you can use the `master` branch of a repo named after `<org>.github.io` - example: https://github.com/aframevr/aframevr.github.io/ automatically gets published to https://aframevr.github.io/)
    7. All content served to users is served from CloudFlare, originally served from the Fastly CDN (for initial page requests/cache misses), which is what every GitHub Pages asset is served from.
    CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane `Cache-Control` and `E-Tag` headers, etc.), minification, etc.

    1. Make sure you have registered a domain name.
    2. Sign up for [CloudFlare](https://www.cloudflare.com/) and create an account for your domain.
    3. In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to [this awesome list of links for instructions for various registrars](https://surge.sh/help/adding-a-custom-domain)).
    4. From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a [Page Rule to force HTTPS redirects](https://support.cloudflare.com/hc/en-us/articles/200168306-Is-there-a-tutorial-for-Page-Rules-). (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
    5. If you don't already have one, create a new repository on GitHub to store your site's contents (preferably in the form of static web pages and assets; though not necessary, for the A-Frame site we use a static-site generator called [Hexo](https://github.com/hexojs/hexo)).
    6. From your domain registrar's settings, create a `CNAME` record to point `<domain>.<tld>` to `<user>.github.io`. (Refer to [the GitHub docs for more information](https://help.github.com/articles/tips-for-configuring-a-cname-record-with-your-dns-provider/).)
    7. In your Github repo, create a file at the root called `CNAME` containing the domain name (e.g., `aframe.io`).
    8. Push to GitHub Pages (either by pushing to `gh-pages` or `master` of your repo; or you can use the `master` branch of a repo named `<org>.github.io` - example: https://github.com/aframevr/aframevr.github.io/ automatically gets published to https://aframevr.github.io/, which redirects to https://aframe.io/)
    9. You're done! All content will now be served to your users from CloudFlare.
  2. @cvan cvan created this gist Apr 6, 2016.
    11 changes: 11 additions & 0 deletions HOWTO.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    # Workflow

    1. Make sure you have registered your domain.
    2. Sign up for CloudFlare and create an account for that domain.
    3. In your domain registrar's admin panel, point the nameservers to CloudFlare's.
    4. From the CloudFlare settings for that domain, enable SSL and set up a [Page Rule to force HTTPS redirects](https://support.cloudflare.com/hc/en-us/articles/200168306-Is-there-a-tutorial-for-Page-Rules-). (If you want to get fancy, you can also enable automatic minification, which is a pretty cool feature if you don't want/have a build step for that.)
    5. On GitHub create a new repository to store all the site (preferably in the form of static web pages and assets, though for the A-Frame site we use something called Hexo - not necessary though, YMMV).
    6. Create a CNAME record to point aframe.io to aframevr.github.io. (See https://help.github.com/articles/tips-for-configuring-a-cname-record-with-your-dns-provider/.)
    7. In your repo, create a file called `CNAME` containing the domain name (e.g., `aframe.io`).
    8. Push to GitHub Pages (either by pushing to `gh-pages` of some ordinary repo; or you can use the `master` branch of a repo named after `<org>.github.io` - example: https://github.com/aframevr/aframevr.github.io/ automatically gets published to https://aframevr.github.io/)
    7. All content served to users is served from CloudFlare, originally served from the Fastly CDN (for initial page requests/cache misses), which is what every GitHub Pages asset is served from.