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

add documentation for development, jekyll #4

Open
repo-reviews opened this issue Jun 13, 2023 · 1 comment
Open

add documentation for development, jekyll #4

repo-reviews opened this issue Jun 13, 2023 · 1 comment
Labels
good first issue Good for newcomers

Comments

@repo-reviews
Copy link
Owner

The below work from https://github.com/github/government.github.com should be helpful:


To Set up Locally

You can take all the files of this site and run them just on your computer as if it were live online, only it's just on your machine.

Requirements

If you have installed GitHub Desktop, Git was also installed automatically.

To copy the repository's files from here onto your computer and to view and serve those files locally, at your computer's command line type:

git clone https://github.com/github/government.github.com.git
cd government.github.com
script/bootstrap
script/server

Open http://localhost:4000 in your browser

Deploying

government.github.com now utilizes a two-repo approach to managing staging and production deployments:

For small changes, you can deploy right to production by merging a pull request. For larger changes, push your branch to the staging repo from Terminal. Here's how to setup staging and deploy to it:

$ script/stage staging

This script will generate the government site (without starting the local server) and prep it for staging. It does this by creating a temporary Git repo within the compiled _site directory and force pushing that to a separate remote repo (in this case, https://ghe.io/government/staging).

Pushing to the staging repo requires authenticating with GitHub via Terminal. You'll be asked for a username and password when running script/stage. Use your GHE.io username and, since we enforce 2FA, use a personal access token as your password.

Having trouble deploying to a staging server? Delete the entire _site directory and try again. Sometimes the temporary Git repository we make in the script can go awry.

When you're done with staging and your pull request has been approved, you can merge your branch. Your changes will be automatically deployed to the production site in a few minutes.


@repo-reviews
Copy link
Owner Author

So far this installs the requirements, but not seeing the site on GCP VM Ubuntu 20.04 LTS:

sudo apt update
# following https://jekyllrb.com/docs/installation/ubuntu/
sudo apt-get install ruby-full build-essential zlib1g-dev
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc
echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
gem install jekyll bundler
# install node.js
sudo apt install nodejs
# following To Set up Locally instructions
git clone https://github.com/github/government.github.com.git
cd government.github.com
script/bootstrap
script/server

@repo-reviews repo-reviews added the good first issue Good for newcomers label Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant