You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Auto Deployment of Discord Bot with Systemd and GitHub Actions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SSH Key pair - Private key in GitHub Secrets, Public key in /root/.ssh/authorized_keys on your server
# Discord Bot token - In GitHub Secrets or Environment Variables.
# This file is the workflow that handles the initial setup of your Discord bot.
# This job should be run only ONCE. Changes in 'create-systemctl-service' are appended to the systemd.service file, not overwritten so the file will be invalid!
# If you make a mistake, and need to run this job more than once, navigate to /etc/systemd/system
This gist has now been 'deprecated' and has moved...
... to my blog style space for easier contribution by third parties and to provide what I believe to be an easier reading experience. Please field all enquiries and issues to the source repository.
Using GitHub Pages with a custom domain: Namecheap Edition
As often happens, I found the official documentation and forum answers to be "close, but no cigar", and so had to experiment a little to get things working.
The main problem for me was a lack of concrete configuration examples. That's not entirely GitHub's fault: having migrated from Google Domains to Namecheap in the middle of this project, I was once again reminded of how many different ways there are to do things in the name service universe [1].
Although you'd think the simplest setup would be to merely configure for the subdomain case (https://www.example.com), in my experience using the apex domain (https://example.com) instead resulted in fewer complications.
Procedure
So here's my recipe for using a custom domain with GitHub pages where Namecheap is the DNS provider:
In this section, we are going to show how to run a python script as a systemd service, allowing you to boot it at the start of a Linux machine and to maintain it alive.
Test method: Telegram Bot
We are going to use a very basic Telegram bot in order to test that our script will:
Automatically start when the machine boot
Automatically restart when it crashes/exits for whichever reason
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters