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

feat: allow user to specify deploymentBranch property in docusaurus.config.js #5841

Merged
merged 3 commits into from Oct 31, 2021

Conversation

wpyoga
Copy link
Contributor

@wpyoga wpyoga commented Oct 31, 2021

Motivation

Allows me to specify the deployment branch in docusaurus.config.js using a new deploymentBranch property, instead of having to use an environment variable. Deployment branch is usually static, so IMHO it should be stored inside docusaurus.config.js .

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

I used this on my own GitHub Pages site. The repo name is wpyoga.github.io, but I deploy to a gh-pages branch, instead of the usually-default master or main branch.

$ yarn add ../docusaurus_allow-deployment-branch-config/packages/docusaurus
$ yarn install
$ USE_SSH=true yarn deploy

Related PRs

If #5840 is merged, then no need to set USE_SSH=true when running yarn deploy on my local repo.

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Oct 31, 2021
@netlify
Copy link

netlify bot commented Oct 31, 2021

✔️ [V2]
Built without sensitive environment variables

🔨 Explore the source changes: 56ff039

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/617e0c85272ddc0008be0a57

😎 Browse the preview: https://deploy-preview-5841--docusaurus-2.netlify.app

@github-actions
Copy link

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 95
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-5841--docusaurus-2.netlify.app/

Copy link
Collaborator

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Actually not a fan of biasing towards GH pages deployment details in the config, but since we already have other options, why not

@Josh-Cena Josh-Cena merged commit ca9bd24 into facebook:main Oct 31, 2021
@Josh-Cena Josh-Cena added the pr: new feature This PR adds a new API or behavior. label Oct 31, 2021
wpyoga added a commit to wpyoga/docusaurus that referenced this pull request Oct 31, 2021
…onfig.js (facebook#5841)

* feat: allow user to specify deploymentBranch property in docusaurus.config.js

* docs: remove extra backtick

* docs: fix broken code block
Josh-Cena added a commit that referenced this pull request Nov 10, 2021
* feat: allow GIT_USER env var to be unset if SSH is used

* fix: packages/docusaurus/src/commands/deploy.ts

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>

* feat: allow user to specify deploymentBranch property in docusaurus.config.js (#5841)

* feat: allow user to specify deploymentBranch property in docusaurus.config.js

* docs: remove extra backtick

* docs: fix broken code block

* docs: fix i18n routes to feature requests (#5843)

* docs: fix i18n routes to feature requests

* Add redirect rules

* feat: allow GIT_USER env var to be unset if SSH is used

* fix: packages/docusaurus/src/commands/deploy.ts

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>

* fix: avoid escaping hyphen in regex

* Refactor

* Update deployment.mdx

* Make SSH higher priority

* Only infer but not override

* Add tests

* Fix tests

* Fix

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants