28 lines
760 B
YAML
28 lines
760 B
YAML
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
|
|
before_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 |