A static Jekyll site for the BCDA splash page: https://bcda.cms.gov
It is assumed that the environment already has these installed:
- npm currently using 6.13.4
- Docker to standardize builds across all contributors' local machines
- Docker Compose to define and run multi-container Docker applications
Navigate to the repository, and install the appropriate Gem file (a Gem file includes the dependencies for Ruby apps):
$ gem install bundler
<— install Gem bundler$ bundle install
<— install Gem bundles$ npm install
<- install node dependancies
Jekyll builds the CSS and HTML pages. Run bundle exec jekyll serve
from the project root for a local build. By default, the site will run in http://localhost:4000/
. You can also run bundle exec jekyll build
to compile the site files into the _site
directory.
Every contributor that uses Docker will have the exact same build as every other contributor. The command for a consistent and simple build process is:
docker compose -f docker-compose.yml build static_site
docker compose -f docker-compose.yml run --rm static_site
This process uses a Docker container to execute bundle exec jekyll build
, compiling site files into the same _site
directory used when executing this command on the Docker host. The advantage here is that there's no need to install ruby or any dependencies on the machine building the static site — Docker takes care of all that.
To host the site in Docker, accessible at http://localhost:4000/
:
docker compose run --publish 4000:4000 --rm --entrypoint "bundle exec jekyll serve -H 0.0.0.0" static_site
This is a convenience meant to ease integration of static site builds with the larger BCDA CI/CD pipeline.
Anyone committing to this repo must use the pre-commit hook to lower the likelihood that secrets will be exposed.
You can install pre-commit using the MacOS package manager Homebrew:
brew install pre-commit
Other installation options can be found in the pre-commit documentation.
Run the following command to install the gitleaks hook:
pre-commit install
This will download and install the pre-commit hooks specified in .pre-commit-config.yaml
.