Skip to content

Commit

Permalink
chore: optimize continuous integration (#1308)
Browse files Browse the repository at this point in the history
* chore: CI should skip deploying v1 if no related changes

* fix regex

* test commit only

* remove static site build test on ci
  • Loading branch information
endiliey authored Mar 25, 2019
1 parent c6c22a8 commit 12d4ca7
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ jobs:
- run:
name: Run Test Suites
command: yarn test
- run:
name: Test v1 static website Builds
command: cd website-1.x && yarn build
- run:
name: Test v2 static website Builds
command: cd website && yarn build

# The CIRCLE_ variables are defined during the CircleCI build process
# https://circleci.com/docs/1.0/environment-variables/
Expand All @@ -81,10 +75,12 @@ jobs:
echo "machine github.com login docusaurus-bot password $DOCUSAURUS_PUBLISH_TOKEN" > ~/.netrc
fi
- run:
name: Deploy Website
name: Deploy v1 Website
# Skip the deploy if we don't have the right org (facebook), or if this is just a pull request
command: |
if [[ $CIRCLE_PROJECT_USERNAME == "facebook" && -z $CI_PULL_REQUEST && -z $CIRCLE_PR_USERNAME ]]; then
if ! git diff-tree --no-commit-id --name-only -r HEAD | grep -E "(^docs\/.*)|(docusaurus-1\.x\/.*)|(website-1\.x\/.*)"; then
echo "Skipping deploy. No relevant v1 website files have changed"
elif [[ $CIRCLE_PROJECT_USERNAME == "facebook" && -z $CI_PULL_REQUEST && -z $CIRCLE_PR_USERNAME ]]; then
echo "Deploying website..."
# install Docusaurus and generate file of English strings
cd website-1.x && yarn run write-translations
Expand Down

0 comments on commit 12d4ca7

Please sign in to comment.