From ad5ca77577eebb977ebb029a318bfe733701aba2 Mon Sep 17 00:00:00 2001 From: Tan Nguyen Date: Wed, 6 Nov 2024 10:45:03 +0700 Subject: [PATCH] Update README.md --- README.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/README.md b/README.md index 8b731f8..f44813f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,71 @@ +a# CSlant Home Runner + +```text +██╗ ██╗ ██████╗ ███╗ ███╗███████╗ ██████╗ ██╗ ██╗███╗ ██╗███╗ ██╗███████╗██████╗ +██║ ██║██╔═══██╗████╗ ████║██╔════╝ ██╔══██╗██║ ██║████╗ ██║████╗ ██║██╔════╝██╔══██╗ +███████║██║ ██║██╔████╔██║█████╗ ██████╔╝██║ ██║██╔██╗ ██║██╔██╗ ██║█████╗ ██████╔╝ +██╔══██║██║ ██║██║╚██╔╝██║██╔══╝ ██╔══██╗██║ ██║██║╚██╗██║██║╚██╗██║██╔══╝ ██╔══██╗ +██║ ██║╚██████╔╝██║ ╚═╝ ██║███████╗ ██║ ██║╚██████╔╝██║ ╚████║██║ ╚████║███████╗██║ ██║ +╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ +``` + +This repo is to set up the runner for updating the homepage at https://cslant.com + +We can use this runner to update the Home automatically with CI/CD pipelines. + +## Installation + +First, copy the `.env.example` file to `.env` and update the values. + +```bash +envsubst < .env.example > .env +``` + +In the `.env` file, update the values to match your environment. + +```bash +# .env + +#SOURCE_DIR=~/source +SOURCE_DIR=/home/user/cslant.com/home + +GIT_SSH_URL=git@github.com:cslant + +# The name of the runner +WORKER_NAME="CSlant Home" + +# add the env to choose "npm" or "yarn" as the installer +INSTALLER=yarn + +# App Config +# E.g: prod, dev +ENV=prod + +NODE_VERSION=22 + +USE_SUBMODULES=false +``` + +> [!IMPORTANT] +> ## Command can't be used if wrong values are set in the `.env` file. +> * If the `SOURCE_DIR` is wrong, the runner will not be able to find the source code. So, please make sure the `SOURCE_DIR` is correct. + +Then, you can just run the following command to start the runner. + +```bash +./runner.sh a +``` + +## Usage + +The runner has the following commands: + +| Command | Description | +|----------------|------------------------------| +| `help`, `tips` | Shows the help message | +| `build`, `b` | Builds the Home | +| `worker`, `w` | Create or restart the worker | +| `all`, `a` | Runs all the commands | # CSlant Home Runner ```text