[英]How can i deploy from github build folder to hostinger server?
I have a project which have directory structure like below and i am hosting the application on Hostinger.我有一个目录结构如下的项目,我在 Hostinger 上托管该应用程序。
The problem is I don't want to deploy the complete code to the server.问题是我不想将完整的代码部署到服务器。 I want to deploy only the build folder which contains required code only.我只想部署仅包含所需代码的构建文件夹。
There is only option to give the GitHub project URL. How can I deploy from a specific folder?只有给 GitHub 项目 URL 的选项。我如何从特定文件夹部署?
As mentioned in hostinger/example-app , you can only specify the GitHub repo and URL.正如在hosts/example-app 中提到的,您只能指定 GitHub 存储库和 URL。
If possible you could consider then using two GitHub repos:如果可能,您可以考虑使用两个GitHub 存储库:
And you would reference the second inside the first with a git submodule add
.您可以使用git submodule add
引用第一个中的第二个。
That way:那样:
hostinger
.您可以在hostinger
指定第二个 repo(只有需要部署的代码的hostinger
)的hostinger
。You can also use apache's .htaccess feature to tweak hosting settings, which is fully supported in hostinger.您还可以使用 apache 的 .htaccess 功能来调整托管设置,hostinger 完全支持该功能。
Create an .htaccess file in the root of your repo with the contents:在您的存储库的根目录中创建一个 .htaccess 文件,其内容如下:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.example.com$
RewriteCond %{REQUEST_URI} !path-to-your-webroot/
RewriteRule (.*) path-to-your-webroot/$1 [L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.