本文共 1509 字,大约阅读时间需要 5 分钟。
暂存区和版本库
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 which makes it easy to automatically deploy the website from a Git branch, in my case hosted on . I will document this process. Other hosting providers that base their CI/CD on a repository might have a similar tool in place.
我正在使用 ,它使从Git分支自动部署网站变得容易,在我的案例中,该站点托管在 。 我将记录此过程。 其他将其CI / CD基于存储库的托管服务提供商可能已经使用了类似的工具。
Netlify automatically builds deploy previews for .
Netlify自动为构建部署预览。
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
分支代码。
翻译自:
暂存区和版本库
转载地址:http://qtmgb.baihongyu.com/