mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-22 20:47:53 +02:00
chore: optimize continuous integration (#1308)
* chore: CI should skip deploying v1 if no related changes * fix regex * test commit only * remove static site build test on ci
This commit is contained in:
parent
c6c22a8271
commit
12d4ca7b70
1 changed files with 4 additions and 8 deletions
|
@ -55,12 +55,6 @@ jobs:
|
||||||
- run:
|
- run:
|
||||||
name: Run Test Suites
|
name: Run Test Suites
|
||||||
command: yarn test
|
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
|
# The CIRCLE_ variables are defined during the CircleCI build process
|
||||||
# https://circleci.com/docs/1.0/environment-variables/
|
# https://circleci.com/docs/1.0/environment-variables/
|
||||||
|
@ -81,10 +75,12 @@ jobs:
|
||||||
echo "machine github.com login docusaurus-bot password $DOCUSAURUS_PUBLISH_TOKEN" > ~/.netrc
|
echo "machine github.com login docusaurus-bot password $DOCUSAURUS_PUBLISH_TOKEN" > ~/.netrc
|
||||||
fi
|
fi
|
||||||
- run:
|
- 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
|
# Skip the deploy if we don't have the right org (facebook), or if this is just a pull request
|
||||||
command: |
|
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..."
|
echo "Deploying website..."
|
||||||
# install Docusaurus and generate file of English strings
|
# install Docusaurus and generate file of English strings
|
||||||
cd website-1.x && yarn run write-translations
|
cd website-1.x && yarn run write-translations
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue