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
- cPanel account Illinois account holders can create a cPanel account at https://web.illinois.edu
- github account
Preparing cPanel
- Identify or create website
- Identify website root folder
- Create an SSH key
Preparing github
- Create Repository
- Create action
deploy-to-cpanel.yml
- 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.