This is a starter repository to help in implementing the Open SDG platform. See here for documentation.
You will need to build the SDG Data site first locally in order to proceed with building and testing the SDG Site Starter first.
1.) Refer to the commands in https://github.com/CityOfLosAngeles/open-sdg-data-starter to setup your local environment.
2.) Proceed to navigate to the _site
in the terminal of VS Code while in the container after building the data site locally and run python3 -m http.server 9000
.
3.) The data site is now accessible via localhost:9000
.
4.) In a separate VS Code window have this project opened and navigate to the _config.yml
file and change remote_data_prefix:
set to "http://localhost:9000"
. Remember to revert this change before committing.
5.) Proceed with the steps below after running bundle config --local path $PWD/vendor/bundle && bundle install
to install the necessary dependencies.
Test what development will look like by running the following command:
bundle exec jekyll serve --config _config.yml
Test what production will look like by running the following command:
bundle exec jekyll serve --config _config.yml,_config_prod.yml
For each command listed above, you will be able to access the site locally by visiting http://127.0.0.1:4000/
. Please be aware that not everything may load due to CORS. You may verify this with ChromeDevTools for example.
To build the development site locally and have _site
directory updated and available:
bundle exec jekyll build --config _config.yml
. Run ./scripts/test/html_proofer_staging.sh
to perform html validation.
To build the production site locally and have _site
directory updated and available:
bundle exec jekyll build --config _config.yml,_config_prod.yml
. Note you may need to change the remote_data_prefix:
in _config_prod.yml
appropraitely as you see fit. Run ./scripts/test/html_proofer_prod.sh
to perform html validation.
GitHub Actions is used for building, verifying, and deploying the site contents. The production GitHub Actions workflow file, BuildNDeployProd.yml
is currently
configured to build, verify, and deploy the site to the production environment. The development GitHub Actions workflow file, BuildNDeployDev.yml
currently is
configured to build and verify the site when git pushes are made to any branch but production
verifying changes within the branch that was pushed. On git pushes to
the development
branch, the workflow will proceed to build, verify, and deploy the site to the development environment.