Bash and Javascript scripts to generate the static site for the Digital Public Goods from a WordPress site. The scripts on this repo are not meant to be used directly, but rather used in the creation of automatic builds through a Continuous Integration (CI) framework, such as a GitHub Pages.
This is one of four interconnected repositories; refer to the publicgoods-website for an overview.
This repository is managed with NPM version 7 workspaces which requires Node version 15 or higher. Read the workspaces documentation to know how to install and manage dependencies across packages in this repository.
To test the functionality of these scripts, you can run the following commands in sequence:
npm i
: Installs all the required project dependenciesgit clone https://github.com/DPGAlliance/publicgoods-website.git ../publicgoods-website
git clone https://github.com/DPGAlliance/publicgoods-candidates.git ../publicgoods-candidates
./scripts/static.bash
: crawls a private instance of the WordPress website and saves a copy in ../publicgoods-website
pushd packages/automation && node consolidate_data.js && popd
: consolidates nomiees and DPGs from the new api into a single nominees.json
file for the registry page.pushd packages/automation && node generate_dpgs.js && popd
: generates the individual website pages for each vetted digital public goodpushd packages/automation && node generate_nominees.js && popd
: queries the GitHub API for activity data for each linked repopushd packages/automation && node index.js && popd
: generates the registry pagepushd packages/registry && npm run build && popd
: builds the React components associated with the registry./scripts/moveFiles.bash
: moves the React components generated above and the registry page into the website folderTo test the result:
cd ../publicgoods-website
./.develop.bash
When a merge is pushed onto the main
branch in the DPGAlliance/publicgood-scripts repository, no build is pushed to the DPGA public website.
The public website is updated under these 3 circumstances:
main
branch of the DPGAlliance/publicgood-candidates repoYou can manually trigger a new website build by visiting the Actions tab on the publicgoods-candidates repo, though you need Write permissions on that repo:
Wait for about 10 minutes, and the new website will reflect the changes from the DPGAlliance/publicgood-scripts repository.