Merge pull request #1 from softinio/migrate-to-circleci
Upgrade to circlci
This commit is contained in:
commit
8413d9fcd7
2 changed files with 22 additions and 15 deletions
22
.circleci/config.yml
Normal file
22
.circleci/config.yml
Normal file
|
@ -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
|
||||
|
|
@ -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
|
||||
|
Loading…
Reference in a new issue