.\components\alert.njk
error This is a dev site.
.\components\alert.njk
notice Application uses Eleventy.
.\components\header.njk
App Title
  • Item 1
  • Item 2
  • Item 3
  • Item 4
Login

Welcome

About this page

This page is created by eleventy by converting the content of the markdown file \src\index.md to html content using the nunjucks template file \src\_layouts\base.njk.

About this project

This project demonstrates using a github action to auto-deploys an eleventy site to UIUC cPanel. It could be modified to publish any repo files or build artificacts to cPanel.

Prerequisites

  1. cPanel account Illinois account holders can create a cPanel account at https://web.illinois.edu
  2. github account

Preparing cPanel

  1. Identify or create website
  2. Identify website root folder
  3. Create an SSH key

Preparing github

  1. Create Repository
  2. Create action deploy-to-cpanel.yml
  3. Add SSH parameters to Action Secrets

Building an Eleventy Site (using npx)

Build

npx @11ty/eleventy --input=./src --output=./_site

Build & Serve

npx @11ty/eleventy --input=./src --output=./_site --serve

This will build any eleventy site from the content in the src folder and public it to the _site directory.

Prepare CPanel

Create CPanel Site

By default your CPanel site will have 1 website with the root "~/public_html"

Creating a new subdomain

You can add another website using cPanel's "Subdomain" feature. This feature will alow you to identify a subdomain (e.g. "fea-1") and a document root (e.g. "~/fea-1_root"). Using the example values new website will be available at http://fea-1.my-acct.web.illinois.edu.

Adding in SSL

Illinois' cPanel has an "SSL/TLS Status" feature that allows you to auto-provision SSL certs for your subdomain. Open the feature and click the "Run AutoSSL". It may take a couple of minutes to complete.