From a8e8c96f8bb2b59a99b4044158ab73b4385f5ac7 Mon Sep 17 00:00:00 2001 From: Salar Rahmanian Date: Thu, 9 Aug 2018 21:02:41 -0700 Subject: [PATCH] Upgrade to circlci --- .circleci/config.yml | 22 ++++++++++++++++++++++ .gitlab-ci.yml | 15 --------------- 2 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 .gitlab-ci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..3fe0709 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,22 @@ +version: 2 +jobs: + build: + docker: + - image: softinio/hugo-docker:latest + working_directory: ~/hugo + environment: + HUGO_BUILD_DIR: ~/hugo/public + steps: + - checkout + - run: git submodule sync && git submodule update --init + - run: hugo -v -d $HUGO_BUILD_DIR + - deploy: + name: deploy to AWS + command: | + if [ "${CIRCLE_BRANCH}" = "master" ]; then + aws s3 sync $HUGO_BUILD_DIR s3://$AWS_BUCKET --delete + aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/*" + else + echo "Not master branch, dry run only" + fi + diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index b2120a7..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,15 +0,0 @@ -# .gitlab-ci.yml -image: registry.gitlab.com/softinio/hugo-docker - -production: - type: deploy - script: - - hugo - - aws s3 sync public/ s3://$AWS_BUCKET - - aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/*" - artifacts: - paths: - - public - only: - - master -