diff --git a/README.md b/README.md index d442711..d22b82b 100644 --- a/README.md +++ b/README.md @@ -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: