hugo deploy
1.0.0
这是通过 GitHub Actions 部署到 Amazon S3 的 Hugo 博客的起点。
这就是我部署 nathany.com、Edmonton Go 和 fsnotify.org 的方式。
本地发展:
hugo二进制文件,在gohugo.io下载。brew install hugo偏僻的:
hugo new site <mysite>创建一个 config.toml 和一些空文件夹。我添加了 .gitkeep 文件,以便签入这些文件夹。assets/sass文件夹,其中包含将转换为 css 的all.sass 。./watch.sh 。.gitignore以避免提交生成的文件。.github/workflows/build.yml )。当更改合并到 GitHub 上的主分支时,GitHub Actions 会自动部署网站。根据我的经验,部署需要几秒钟才能完成。
此存储桶策略提供对 S3 中文件的公共访问。
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::hugo-deploy-example/*"
]
}
]
}