自动化将新构建上传到网站的过程。 IE NPM Run Build-> CPANEL上传

发布于 2025-02-10 18:24:50 字数 337 浏览 1 评论 0原文

我正在通过GoDaddy管理一个大多数静态的网站。

该网站是一个React单页应用程序,目前仍在开发中,偶尔需要更新内容。该项目文件夹是作为公共GIT存储库托管的。

我的目标是能够自动化更新网站的过程。目前,我需要:

  1. NPM Run build
  2. 导航到Windows Fileser中的构建文件夹
  3. 导航到CPANEL中的public HTML文件夹,在我的Web浏览器中,
  4. 删除了当前构建文件
  5. 上传构建文件的内容到cpanel,cpanel,by filler(cpanel) 不允许我上传子文件夹。

I am managing a mostly static site through GoDaddy.

The site is a React single page application, that is still currently under development, and that occasionally needs content updating. The project folder is hosted as a public git repository.

My goal is to be able to automate the process of updating the site. Currently I need to:

  1. npm run build
  2. navigate to the build folder in windows file explorer
  3. navigate to the public html folder in cpanel, in my web browser
  4. delete the current build files
  5. upload the contents of the build files into cpanel, folder by folder (cpanel will not allow me to upload subfolders)

I have looked through countless forum posts, and blogs, etc to find a way to automate this, but I always end up doing it manually.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一杯敬自由 2025-02-17 18:24:51

您需要使用连续部署(CD/CI)并使用其他托管设置进行调查。不幸的是,您使用的平台类型(与CPANEL)是有限的,并且在您的用例中并不是真正的定向。

但是 cpanel确实有一个使用git版本控制的选项管理帐户中的文件和文件夹。进入此选项并说“克隆存储库”,您必须在其中链接回购并说出应该安装的位置。 注意:您的托管提供商可能已禁用了此功能。

我怀疑此CPANEL功能在更新回购时不会自动进行更改,因此您可能仍然需要手动克隆回购库同样,当您进行更改(这仍然比复制文件更容易)。另请注意,您存储的任何数据再次克隆时都可以删除。

You need to investigate using continuous deployment (CD/CI) and using a different hosting setup. Unfortunately, the type of platform that you use (with CPanel) is limiting and is not really oriented at your use case.

However, CPanel does have an option to use Git version control to manage the files and folders in your account. Go into this option and say "Clone repository", where you'll have to link a repo and say where it should install. Note: It is possible that your hosting provider has disabled this feature.

I suspect that this CPanel feature does not automatically pull in changes when you update the repo, so you would probably still need to manually clone the repo again when you make changes (which is still easier than copying files over). Also note that any data you store may be removed when cloning again.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文