まえがき
こちらのほぼ続きです。
テンセントクラウドのバケット(COS)をServerless Framework経由で作成する
https://qiita.com/antk/items/4f1787304101f2e667a6
上記で作成したバケットに静的サイトをデプロイします。
ディレクトリ構成
必要最低限の構成としてはこんな感じ。
my-homepage
├── src
│ └── index.html
├── .env
└── serverless.yml
デプロイ
.env
の中身は↑の記事と同じでOK。
serverless.yml
はこんな感じ。
serverless.yml
app: tencent-website
name: my-homepage
component: website
inputs:
src:
root: ./
src: ./src
index: index.html
websitePath: ./
region: ap-tokyo
bucketName: 上記の記事で作ったバケット名
protocol: http
htmlしかないような構成ならこれでいけるはず。
serverless ⚡framework
Action: "deploy" - Stage: "dev" - App: "tencent-website" - Instance: "my-homepage"
region: ap-tokyo
website: http://デプロイできたリンク
前往控制台查看应用详细信息: https://serverless.cloud.tencent.com/xxxxxxxxxx
177s › my-homepage › Success
できました。
至らない部分もかなりありそうですがドキュメントを読んで補完していただけると嬉しいです(ご指摘のコメントいただけるともっと嬉しいです)。