doc: update deploy to s3 and build website

This commit is contained in:
Leon Xu committed 2021-07-13 09:56:20 -07:00
1 parent 6358f5ae0c
commit 97da7db3d6
1 file changed
+25 -18
+25 -18
View File
@@ -1,20 +1,27 @@
# requiring the environment of NodeJS 4.2.2 build website:
image: node:latest stage: build
# add 'node_modules' to cache for speeding up builds # requiring the environment of NodeJS 4.2.2
cache: image: node:latest
paths: # add 'node_modules' to cache for speeding up builds
- node_modules/ # Node modules and dependencies cache:
before_script: paths:
- npm install -g hexo-cli # Install Hexo itself - node_modules/ # Node modules and dependencies
- npm install # Install Hexo modules and dependencies before_script:
# the 'pages' job will deploy and build your site to the 'public' path - npm install -g hexo-cli # Install Hexo itself
pages: - npm install # Install Hexo modules and dependencies
stage: deploy # the 'pages' job will deploy and build your site to the 'public' path
script:
- hexo clean # HExo clean prior site
- hexo generate # Hexo generate Static Site
artifacts: artifacts:
paths: paths:
- public - public
only:
- master # this job will affect only the 'master' branch 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