FTP & GitHub Actions. Today I Learned: Friday 15 July 2022

  • The default main branch name when initializing a git repository differs from local git GitHub. Locally, the default branch name is ‘Master’, whereas, on GitHub, the name is ‘Main’.

  • A headless browser is a browser without a GUI. One example would be the Live Preview browser extension for Visual Studio Code.

  • You can use FTP (File Transfer Protocol) to automatically deploy code from GitHub to cPanel. https://www.youtube.com/watch?v=NVXxY08GH8o

  • I just used this guy’s tutorial to set up an FTP server on GitHub and then use GitHub actions to deploy an index.html and styles.css file to my file manager in cPanel.
    https://www.youtube.com/watch?v=NVXxY08GH8o
    This is pretty good, I just learned two new skills in one video. My problem now is that the index.html file is not in the right folder, I think. I need to reconfigure it to deploy the code into the public.html folder so that is what the browser will identify as the page to display.

  • Public_html, this folder is found within the file manager of Cpanel. This is where you upload your HTML file to be displayed in the browser.

  • I just uploaded my updated HTML and CSS files in file manager by using FTP and GitHub actions. Feels good man.
    By the looks of it, if you upload a file into the public_html folder that has the same name as another file in the folder, the new file will overwrite the old one. For example the index.html file.

  • I faced a problem where the website was not updating. It turns out that the hosted folder I was uploading to was named ‘Public_html’, whereas it should have been ‘public_html’. So what happened was that a new folder was created with the former’s name that included the HTML and CSS files, as well as another file that I didn’t recognize. I’ll know better next time.

  • When I uploaded the files, the website wasn’t updating. I chatted with NameCheap support, and they said the site should be updated immediately after new files are uploaded.

    So I went back to my files and realized that there was no link to the CSS in the HTML’s header, just a bootstrap link which I don’t think was even being used. I added the CSS link and uploaded it again, problem solved.