Deployment - archcoder-jd/Fadeout GitHub Wiki

Deployment

Fadeout is hosted on cPanel and deployed from GitHub using cPanel's Git Version Control. The website and the Node.js proxy are deployed together.

Layout on the server

What Where Served at
Website files The subdomain's folder fadeout.venture31.com
Node.js proxy ~/fadeout-api (outside the web folder) fadeout.venture31.com/api

The proxy lives outside the website's folder so its code can't be opened in a browser.

One-time setup

  1. Create the subdomain in cPanel under Domains. Fadeout needs its own subdomain so its index.html doesn't replace another site's homepage.
  2. Create the Node.js app in cPanel's Node.js app manager:
    • Node.js version: 18 or newer (the proxy uses the built-in fetch)
    • Application mode: Production
    • Application root: fadeout-api
    • Application URL: the subdomain, with api as the path
    • Application startup file: app.js
    • Environment variable: TMDB_TOKEN set to the TMDB Read Access Token
    • Click Create
  3. Connect the repo in Git Version Control: click Create and paste https://github.com/archcoder-jd/Fadeout.git as the clone address.

What .cpanel.yml does

cPanel runs this file on every deploy. It:

  1. Copies the HTML pages and the css, js and assets folders into the subdomain's folder
  2. Copies server/app.js and server/package.json into the Node.js app folder
  3. Touches tmp/restart.txt, which restarts the Node.js app so it picks up the new code

Only the files it lists are deployed. Anything else in the repo, such as documentation, stays off the live site. If you add a new page or folder, add it to the copy line.

Deploying an update

  1. Commit and push to GitHub.
  2. In cPanel, go to Git Version Control → Manage → Pull or Deploy.
  3. Click Update from Remote, then Deploy HEAD Commit.
  4. Run through Testing.

If the proxy doesn't pick up a change, click Restart on the app in the Node.js screen.