Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1 site does not deploy due to CircleCI #4394

Closed
slorber opened this issue Mar 11, 2021 · 2 comments
Closed

v1 site does not deploy due to CircleCI #4394

slorber opened this issue Mar 11, 2021 · 2 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@slorber
Copy link
Collaborator

slorber commented Mar 11, 2021

🐛 Bug Report

Opening this bug report mostly to document this issue.

When we merge on master some new code, CircleCI is supposed to run, and deploy the v1 website on GH pages if there is any git diff change.

      - run:
          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 ! 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 v1..."
            else
              echo "Skipping deploy."
            fi

The problem is that some of our users are using a Github pull bot that opens a PR to sync their fork whenever we push to master.

kadirselcuk#41

We end up with $CI_PULL_REQUEST to never be empty for CircleCI (looks like a bug to me), and the v1 site deploy is constantly skipped.

For example https://app.circleci.com/pipelines/github/facebook/docusaurus/3917/workflows/cd176276-dd7b-42da-9e88-607f6d1a450e/jobs/22218

image

I will simplify the workflow to fix this temporarily, but soon the v1 site deployment will be on netlify (note: v1.docusaurus.io is already using netlify and deploys fine)

@slorber slorber added the bug An error in the Docusaurus core causing instability or issues with its execution label Mar 11, 2021
@slorber
Copy link
Collaborator Author

slorber commented Mar 11, 2021

Hopefully, $CIRCLE_PR_USERNAME is not set in this case, as it's only set in forks.

image

While this one (new name for deprecated CI_PULL_REQUEST) seems to be able to be set in upstream:

image

@slorber
Copy link
Collaborator Author

slorber commented Mar 11, 2021

fixed by #4395

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

No branches or pull requests

1 participant