暂存区和版本库_如何创建网站的暂存版本

暂存区和版本库

I was in the process of launching a course, and I needed to finalize the landing page that would be up on the “launch day”, without however changing the current version of the site I had up for the public.

我当时正在启动一门课程,我需要完成在“发布日”上将要到达的登录页面,而不更改我为公众准备的网站的当前版本。

I am using Netlify which makes it easy to automatically deploy the website from a Git branch, in my case hosted on GitHub. I will document this process. Other hosting providers that base their CI/CD on a Git repository might have a similar tool in place.

我正在使用Netlify ,它使从Git分支自动部署网站变得容易,在我的案例中,该站点托管在GitHub上 。 我将记录此过程。 其他将其CI / CD基于Git存储库的托管服务提供商可能已经使用了类似的工具。

Netlify automatically builds deploy previews for Pull Requests.

Netlify自动为Pull Requests构建部署预览。

So what I did is, I created a new branch, which I called launch, and started working on it by adding a few commits, then I created a Pull Request, something that GitHub Desktop makes very easy:

所以我要做的是,创建了一个新分支,称为launch ,并通过添加一些提交开始对其进行操作,然后创建了一个Pull Request,这使得GitHub Desktop变得非常容易:

Immediately after I sent the PR in, Netlify started its Continuous Integration / Continuous Delivery pipeline:

在我发送PR以后,Netlify立即开始其持续集成/持续交付管道:

And switching to the Netlify website, I can see it automatically picked up the Pull Request branch, and started a deploy preview:

切换到Netlify网站,我可以看到它自动拾取了Pull Request分支,并开始了部署预览:

After a few minutes, I got a new URL for the website and I used that to go on with the course launch preparation, while the main domain still pointed to the master branch code.

几分钟后,我获得了该网站的新URL,并用它进行了课程启动准备,而主域仍指向master分支代码。

翻译自: https://flaviocopes.com/website-staging-version/

暂存区和版本库

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值