Concern about repo safety with github actions deploy

Hi all,

Just a preface to emphasise that this is not a whinge :slight_smile: that I think Zola is fantastic and great work!!!

I am not sure what I have done wrong, but I successfully ran the GitHub actions and it not only overwrote my repo but it also deleted the repo history. Fortunately, I still have a local commit for the repo. But this is concerning. This workflow needs to be explained better to prevent noobs (like me!) from losing their websites.

Steps to replicate:

  1. Have a GitHub repo myname.github.io for your Zola project.
  2. Run the GitHub action to deploy Zola in /docs
  3. Website didn’t work
  4. Try again point to the root of the repo
  5. Repo is completely replaced by the build files and no git history remains.

So I have one question and one suggestion.
The question is:
Should I be using a different repo than myname/myname.github.io? Say myname/mywebsite and build this so that it ends up in myname/myname.github.io?
PS: I have a custom domain name, myname.dev associated with myname/myname.github.io

My suggestion is that there needs to be a warning here in the instructions to steer users away from this problem.

I think that my problem was that I thought that gh-pages branch should be replaced by my source branch. Because I used my source branch, then my source was overwritten.

Phew, disaster averted with git push --mirror git@github.com:myname/website.git

I don’t maintain the GH action so it would be better to open an issue on their repo. Maybe it’s missing some documentation/explanations?

I don’t maintain the GH action so it would be better to open an issue on their repo. Maybe it’s missing some documentation/explanations?

Done.
This is related to zola-deploy-action/issues/26/keep commit history in gh-pages branch. If this issue was fixed then there would be no problem. And even if someone accidentally overwrote their source then they could just revert.