doc: update README to include aws-cli

This commit is contained in:
Leon Xu committed 2021-07-13 10:16:08 -07:00
1 parent 40bfd1a585
commit be7ee24384
1 file changed
+33
+33
View File
@@ -69,6 +69,39 @@ pages:
- master # this job will affect only the 'master' branch
```
### GitLab-CI with AWS
In case if you want to deploy your website via AWS S3, here are the CI script:
```
build website:
stage: build
# requiring the environment of NodeJS 4.2.2
image: node:latest
# add 'node_modules' to cache for speeding up builds
cache:
paths:
- node_modules/ # Node modules and dependencies
script:
- npm install -g hexo-cli # Install Hexo itself
- npm install # Install Hexo modules and dependencies
- hexo version
# the 'pages' job will deploy and build your site to the 'public' path
artifacts:
paths:
- public
deploy to s3:
stage: deploy
image:
name: amazon/aws-cli
entrypoint: [""]
script:
- hexo clean
- hexo generate # Hexo generate Static Site
- aws --version
- aws s3 rm s3://$S3_BUCKET --recursive
- aws s3 cp public s3://$S3_BUCKET --recursive
```
### Testing our builds before pushing content to the `master` branch
What if we want to test our builds in another branch before afecting `master`?
We'll just need to set a `test` job to do this for us: