Setting up and connect Gitlab Runner
In Avada SasS, we need to configure a self-hosted runner instead of pay as you go shared runner for the sake of fixed cost in operating. Your team may need to configure your own Gitlab runner instance to run your own app CI/CD jobs.
In the future, many tasks may requires CI/CD, not just deploying your app to Serverless platform, but also running testing automation scripts, etc.
Prepare your Compute Engine instance
Section titled “Prepare your Compute Engine instance”It is recommended to create a Compute engine instance with this configuration to save time running CI/CD jobs with Avada SasS

Install docker
Section titled “Install docker”On your Ubuntu instance, you will need to install Docker first. Please follow this official guide
Set up Docker’s apt repository.
# Add Docker's official GPG key:sudo apt-get updatesudo apt-get install ca-certificates curlsudo install -m 0755 -d /etc/apt/keyringssudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.ascsudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/nullsudo apt-get updateInstall the Docker packages.
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-pluginInstall gitlab runner
Section titled “Install gitlab runner”For Linux (Debian/Ubuntu/Mint), you can install Gitlab Runner here: https://docs.gitlab.com/runner/install/linux-repository.html
Start Docker Daemon
Section titled “Start Docker Daemon”sudo service docker startRegister your Gitlab runner
Section titled “Register your Gitlab runner”You go to your runners management page on Gitlab, you will find the guide for registering a runner here, with the command like:

sudo gitlab-runner register \ --url "https://gitlab.com/" \ --registration-token "$RUNNER_TOKEN" \ --executor "docker" \ --docker-image node:16 \Verify your runner connection
Section titled “Verify your runner connection”sudo gitlab-runner verifyAlso, in case you lose connect to Gitlab, run this command again to regain the connection.
Prune the database
Section titled “Prune the database”When we want to clear the docker caches, we need to run this command to save disk space.
sudo docker system prune -a --volumesIf the verification works, the instance will soon take the jobs on your Gitlab account.
Cron clear cache
Section titled “Cron clear cache”sudo apt updatesudo apt install cron
sudo systemctl enable cronsudo systemctl start cron
sudo apt install vim
sudo crontab -e0 0 * * * /usr/bin/docker system prune -a --volumes -fMax disk, no space left
Section titled “Max disk, no space left”sudo docker system prune -a --volumes -fIf above prune does not work, use below
sudo rm -rf /var/lib/dockersudo systemctl restart dockersudo systemctl restart gitlab-runnersudo gitlab-runner verify