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

Improve support for deploying in out-of-tree locations #81

Merged

Conversation

g-oikonomou
Copy link
Contributor

This pull improves our configuration in order to better support deploying a website to an out-of-tree location by using:

bundle exec jekyll build --destination <destination>

The proposed configuration changes do not harm (maybe they even improve) the current default approach of deploying in a separate branch of the al-folio repo.

The pull also documents this method in the README.md, explicitly flagging it as "for advanced users".

Motivation: We are currently assuming that users host the website's sources and the deployed version as different branches of the same repo. An alternative use-case is for the sources to be in one repo and the deployment version under a totally different repo. This could be the case for example if a project's website is hosted under a subdir of the project's main repo (for example a docs subdir under the master branch of the project's main repo).

In terms of keep_files, this pull makes the following assumptions about <destination>:

  • For user github pages, it is almost certain that there will be a .nojekyll file in the top-level dir.
  • For user github pages, a CNAME may be in use if the user is using a custom domain.
  • It is very likely (almost certain) that <destination> will be a git-versioned repo. We therefore need to leave .git/, .gitignore alone.

In terms of the exclude list:

  • We remove vendor, since there does not appear to be a file/directory with that name in al-folio's source tree
  • We add bin and the Gemfiles, since they don't really need to be in the deployment location

@alshedivat
Copy link
Owner

Great! Thanks for your contribution. I'm happy to merge once Travis CI build works.

@alshedivat
Copy link
Owner

I'm happy to merge this PR. Could you please resolve conflicts with master (it was just upgraded to v0.3.0) and I'll take another look. Thanks!

This commit allows users to deploy their website in an out-of-tree location by using:

```
bundle exec jekyll build --destination <destination>
```

Motivation: We are currently assuming that users host the website's sources and the deployed version as different branches of the same repo. An alternative use-case is for the sources to be in one repo and the deployment version under a different repo. This could be the case for example if a project's website is hosted under a subdir of the project's main repo (for example a `docs` subdir under the `master` branch of the project's main repo).

In terms of `keep_files`, this commit makes the following assumptions about `<destination>`:
* For user github pages, it is almost certain that there will be a `.nojekyll` file in the top-level dir
* For user github pages, a `CNAME` may be in use if the user is using a custom domain
* It is very likely (almost certain) that `<destination>` will be a git-versioned repo. We therefore need to leave `.git/`, `.gitignore` alone

In terms of the `exclude` list:
* We remove `vendor`, since there does not appear to be a file/directory with that name in al-folio's source tree
* We add `bin` and the `Gemfile`s, since they don't really need to be in the deployment location
@g-oikonomou g-oikonomou force-pushed the contrib/deploy-out-of-tree branch from d8f72bb to 4f9fca5 Compare June 28, 2020 14:14
@g-oikonomou
Copy link
Contributor Author

Rebased

@alshedivat alshedivat merged commit d3082bd into alshedivat:master Feb 9, 2021
github-actions bot added a commit that referenced this pull request Feb 9, 2021
* Improve support for deploying in out-of-tree locations

* Document how to deploy in an out-of-tree location

* Add vendor to excludes in _config.yml

* Update README.md

Co-authored-by: Maruan Al-Shedivat <alshedivat.maruan@gmail.com> [ci skip]
song-qun pushed a commit to song-qun/song-qun.github.io that referenced this pull request Mar 19, 2021
* Improve support for deploying in out-of-tree locations

* Document how to deploy in an out-of-tree location

* Add vendor to excludes in _config.yml

* Update README.md

Co-authored-by: Maruan Al-Shedivat <alshedivat.maruan@gmail.com>
LoryPack pushed a commit to LoryPack/lorypack.github.io that referenced this pull request Apr 9, 2021
* Improve support for deploying in out-of-tree locations

* Document how to deploy in an out-of-tree location

* Add vendor to excludes in _config.yml

* Update README.md

Co-authored-by: Maruan Al-Shedivat <alshedivat.maruan@gmail.com>
MichaelHilton pushed a commit to MichaelHilton/MichaelHilton.github.io that referenced this pull request Jul 22, 2021
* Improve support for deploying in out-of-tree locations

* Document how to deploy in an out-of-tree location

* Add vendor to excludes in _config.yml

* Update README.md

Co-authored-by: Maruan Al-Shedivat <alshedivat.maruan@gmail.com>
antchristou pushed a commit to antchristou/antchristou.github.io that referenced this pull request Nov 20, 2023
* Improve support for deploying in out-of-tree locations

* Document how to deploy in an out-of-tree location

* Add vendor to excludes in _config.yml

* Update README.md

Co-authored-by: Maruan Al-Shedivat <alshedivat.maruan@gmail.com>
siantonelli pushed a commit to siantonelli/siantonelli.github.io that referenced this pull request Oct 26, 2024
* Improve support for deploying in out-of-tree locations

* Document how to deploy in an out-of-tree location

* Add vendor to excludes in _config.yml

* Update README.md

Co-authored-by: Maruan Al-Shedivat <alshedivat.maruan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants