Codepipeline 練習 deploy blog
以 build & deploy blog 練習使用 CodePipeline 相關 service。
- 在 CodeCommit 開 repository,把 blog source 放上去。CodeCommit 是類似 Github 的 AWS service。
- CodePipeline 的 Source stage 設定 source 為 CodeCommit。
- Build stage 使用 CodeBuild,image 用 AWS 的 Ubuntu image。
- 在 source code 裡加入
buildspec.yml
,讓 CodeBuild 知道要跑什麼,內容如下:
1 | version: 0.2 |
- deploy stage 設定 deploy 到 S3 的 static web hosting bucket。
pipeline 會在 push code 後自動開始跑,一路 build 出 static html、deploy 到 S3。source stage 跟 build stage 的 artifact 會存到 S3。