From 97da7db3d6c42e6a6bd96d97616a241a08918d5a Mon Sep 17 00:00:00 2001 From: Leon Xu <6479451-leonxu260@users.noreply.gitlab.com> Date: Tue, 13 Jul 2021 09:56:20 -0700 Subject: [PATCH] doc: update deploy to s3 and build website --- .gitlab-ci.yml | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e497e60..64abd34 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,20 +1,27 @@ -# 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 -# the 'pages' job will deploy and build your site to the 'public' path -pages: - stage: deploy - script: - - hexo clean # HExo clean prior site - - hexo generate # Hexo generate Static Site +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 + # the 'pages' job will deploy and build your site to the 'public' path artifacts: paths: - - public - only: - - master # this job will affect only the 'master' branch + - 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 \ No newline at end of file