Github Action 与 Laravel 自动发布

不想每一次 push 后,手工去服务器上拉取代码,github 的 action 功能,可以自动 push 到我的服务器,这真是一个强大的功能,省去了很多麻烦。

我主要是参考了这个文章 Build, Test, and Deploy Your Laravel Application With GitHub Actions (twilio.com) 体验下来,发现一个不足的问题,就是 ssh 权限的问题,必须要给一个 ssh 的 private key 才可以。

还有一种解决方案 Install and configure Deployer | Deploy your Laravel app from scratch | Loris (lorisleiva.com) 就是用 Deployer,个人不是特别喜欢,How to create a CI/CD for a Laravel application using GitHub Actions – LogRocket Blog 这种方法可以指定到某一个版本。

20220614np4Y5N

发表评论