Skip to content

Commit

Permalink
Feat:circleci (decentraland#129)
Browse files Browse the repository at this point in the history
* Feat: CircleCI Deploy YAML

* Adding public to gitignore

* Testing DEV before moving on

* Testing circle

* Fixing typo

* Testing the right env

* Final env testing

* Ready to rumble
  • Loading branch information
Miguel Gagliardo authored Feb 17, 2020
1 parent ea6c98e commit 6dd585c
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
93 changes: 93 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
version: 2
jobs:
build:
docker:
- image: circleci/node:10-browsers
working_directory: /tmp/market
steps:
- checkout
- run:
name: Run NPM
command: |
npm i && \
npm run build
- save_cache:
name: Save the built files
paths:
- public
key: build-{{ .Revision }}

deploy:
docker:
- image: circleci/node:10-browsers
working_directory: /tmp/market
steps:
- restore_cache:
name: Restore built files
keys:
- build-{{ .Revision }}
- run: sudo apt-get -y -qq install awscli curl
- run:
name: Configure AWS Keys
command: |
aws configure set aws_access_key_id ${AWS_ACCESS_KEY_ID} && aws configure set aws_secret_access_key ${AWS_SECRET_ACCESS_KEY}
- run:
name: Deploy to S3
command: cd public && aws s3 sync . s3://${S3_BUCKET}/
- run:
name: Invalidate cloudflare cache
command: curl --silent ${PURGE_CACHE_URL}

workflows:
version: 2
build-deploy-dev:
jobs:
- build:
context: market-dev
filters:
branches:
only: master
- deploy:
context: market-dev
requires:
- build
filters:
branches:
only: master
build-deploy-stg:
jobs:
- build:
context: market-stg
filters:
branches:
only: staging
- deploy:
context: market-stg
requires:
- build
filters:
branches:
only: staging
build-deploy-release-org:
jobs:
- build:
context: market-prd
filters:
branches:
only: release
- deploy:
context: market-prd
requires:
- build
filters:
branches:
only: release
build-branch:
jobs:
- build:
filters:
branches:
ignore:
- master
- release
- staging
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ typings/

# Built files
dist
public

# Indexer generated data
indexer/build
Expand Down

0 comments on commit 6dd585c

Please sign in to comment.