GetPublii / Publii

The most intuitive Static Site CMS designed for SEO-optimized and privacy-focused websites.
https://getpublii.com
GNU General Public License v3.0
6.16k stars 412 forks source link

Publish to cloudflare pages unreliable #996

Open strelok899 opened 3 years ago

strelok899 commented 3 years ago

I created github private repo. Then connect it to cloudflare pages to automatically deploy commit to master. All good here. Now the problem is when I sync from publii to gitlab to cloudflare pages. Is a lot of times gets error on the last step of checking . So I need to do sync serval times to make publii push the compiled files to github repo.

When I tried to use git hub pages it worked flawless. So as I understand it the problem is that publii tries to verify the uploaded content on the final url and it can't verify on time because of the relative long deploy process.

dziudek commented 3 years ago

Hi,

Do you have a sync issue or the only problem is a fact that when click "Visit website" then the page is not updated yet on cloudflare pages?

strelok899 commented 3 years ago

The sync gives 502 bad gateway, and errors after some retries its works

dziudek commented 3 years ago

Hmmm, so it must be some issue with Github, because Cloudflare syncs the website automatically when Github repository is updated. So technically there is no difference if you are using Github Pages or Cloudflare pages - both uses Github sync.

TheUltimateAbsol commented 2 years ago

Doesn't gitlab pages structure the files very differently from github (i.e. stuffing them in a public folder and serving from there?)?

Is it even POSSIBLE to use gitlab pages with cloudflare?

EDIT: yes it is, turns out you just need to set the output folder in cloudflare pages to be "public"

oeed commented 11 months ago

I am getting this all the time, appears to be the same as #1174. It seems to be happening basically every time I sync now my site has more posts and lots of large media files.

[Wed, 04 Oct 2023 04:18:16 GMT] (i) TRIED AGAIN: (api) => api.gitdata.createTree - undefined
[Wed, 04 Oct 2023 04:18:27 GMT] (i) TRIED AGAIN FAIL: (api) => api.gitdata.createTree - undefined
[Wed, 04 Oct 2023 04:18:27 GMT] ERROR: {"code":502,"status":"Bad Gateway","message":"{\n  \"message\": \"Server Error\"\n}\n"}

Seems to be related to: https://github.com/BetaHuhn/repo-file-sync-action/issues/246

dziudek commented 11 months ago

Hi,

As GitHub and Gitlab APIs are quite problematic in handling, especially larger websites - in Publii v.0.44 planned for the next month we will implement Git support - it will be much faster and more reliable method of syncing pages. I have started the implementation using isomorphic-git and it seems to be a big step forward for any git-based websites.

If you are interested in this feature - I will prepare test version of Publii which will contain this feature, probably in the nearest 1-2 weeks. If you will want to use it earlier as beta-tester - feel free to leave a comment with platform which you are using.

When the beta version of this feature will be ready - I will prepare a separate issue with links to download

oeed commented 11 months ago

@dziudek amazing, is it currently on a branch? I have a fork with a few tiny changes to support values I need, so I can just update from that branch (or if you want I can just PR my changes if they look reasonable, just never bothered as they're quite tiny) https://github.com/GetPublii/Publii/compare/master...oeed:Publii:feed-tags

dziudek commented 11 months ago

@oeed - it is not ready yet, I will publish an information when the feature will be able for tests - most probably in the upcoming week :)