Vue3 + vite + ssg + s3 hosting with custom domain
- aws cli & enough role to manipurate s3 with cloudformation
- your domain & dns
Replace xxx to your property and run the following command.
aws cloudformation create-stack \
--profile xxxxx \
--template-body file://cloudformation.yaml \
--stack-name xxxxx \
--parameters ParameterKey=YourDomainName,ParameterValue=XXXXX
It's enough for your role to have AmazonS3FullAccess
& AWSCloudFormationFullAccess
.
Expected result is like following.
{
"StackId": "arn:aws:cloudformation:yourrigion:XXXXXXXXXX:stack/stackname/yourid"
}
Run following command and find bucket's WebsiteURL domain in Outputs
.
aws cloudformation describe-stacks \
--profile xxxxx \
--stack-name xxxxx
And set your DNS record CNAME
(or ALIAS
) to the domain on your DNS console.
Set following github secret
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
Edit your posts in /articles
folder and push them to master
branch, and github actions deploy all generated files to the s3 bucket.