Does SFTP BSS publishing to Github repository still work? Resolved!

I spent hours trying to publish my site files to a Github repository via SFTP, as per the documentation instructions, and with no success, it always generates the error below.

If anyone here has done, or still publishes the site in the Github repository with the SSH key and can give me a tutorial on how to do it as well as screenshots to better understand it, I’d appreciate it.

If this no longer works, it would be recommended to pull this information out of the program’s tutorial documents.

@gilmar you are going about this the wrong way. The SSH key is for uploading/syncing → pushing to GitHub without a password.

The instructions give you steps to make an export script.

1 Like

Hello @apowell656 , can you export the site to the Github repository?
If so, could you explain and give me an example?

Even though GitHub gives you SSH access for publishing, they don’t support SFTP. Their SSH is locked down so only the git command can work.

1 Like

Hi @martin so how does this work?
Could you enlighten me in more detail?

This uses the git command to push your website, not SFTP. The git command is the only supported one by github’s servers.

@gilmar you are doing two things here.

  1. Creating a new repo - this is also the referenced “Export Destination” in “Export Settings”. So yes you can export the site to the GitHub repository, but you have to create the repo first. If you create it on the site first you have to clone it and if you create it locally first you need to push it to the remote.
  2. Creating an export script – automating the commands to push updates to the repo to be published on GitHub pages.

So, if you already have the repo created and add the exported site to the folder where the repo is run the following commands (make sure you are in the folder of your repo):

git add -A
git commit -m 'Site update'
git push origin main 
 OR 
git push

If the site is updated with your changes you have done everything correctly. If not go back to step one.

Once you can complete the above manually write your script and attach it to your export process. I hope this helps.

2 Likes

@apowell656, thank you so much, it worked! But…
I will report my case here, it may be of use to someone in the future.
I use, used, Github Desktop, so I had to make some tweaks in Windows so the script could work, I had to remove the github credentials through the Windows control panel.
Control Panel\User Accounts\Credentials Manager
Every time I exported the project it was not published on Github, that’s because Windows used a different user, one already registered in the credentials, so… it was a monstrous waste of time, but I managed, with the help of a friend and a lot of research on the Internet:

1 - Solve the configuration problem on my Windows;
2 - Publish my site on Github repository.

Thanks!