需要用到
- 安裝aws-cli 在自己的電腦
- 安裝 hexo-deployer-aws-s3
- 建立hexo框架
配置
- 使用指令aws configure
- 利用LearnLab 配置SDK的config可以從 show detail查看
- 配置後檔案放在 user/.aws 有config和credentials
- 開啟bucket的ACL 才能將hexo deploy上
1
2
3
4
5deploy:
type: aws-s3
bucket: bucketName
region: Your Region - 配置hexo config.yaml的deply
- 配置bucket Policy 允許獲取物件
1
2
3
4
5
6
7
8
9
10
11
12{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadForGetBucketObjects",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::bucketName/*"
}
]
}
總結步驟
1.在aws 創建完bucket
2.安裝aws cli
3.配置aws SDK開發所需的憑證
4.開啟 bucketACL
5.npm i -D hexo-deployer-aws-s3
6.hexo deploy