Github actions runs but fails to create the public folder

Show your workflow file for Github. Gitignore is most probably not relevant to the issue.

Edit: also, if your repo is public then show us the failed artefacts of the workflow run. That’s everything you find under the “Actions” tab of your repo.