The biodiversitydata.se website built with Jekyll and tailwindcss.
The local dev environment runs in Docker using dev.Dockerfile and docker-compose.yml.
Build and run locally on http://localhost:4000:
make run
Rebuild the development docker image:
make rebuild
As described below the latest build is automatically deployed to production. Therefore anything commited to the main branch must be production ready. If your work is not production ready use the develop branch or a feature branch.
The application is installed in production using the web role in sbdi-install.
Github Actions is used for building the production Docker image (using Dockerfile). The build workflow is triggered when a push is made to the main branch. It will build the Docker image and push it to the Github Container registry.
The latest build image will automatically be deployed to production every 30 minutes. This is done by a cronjob in the Docker swarm that pulls the latest image (if there is one) and restarts the application (if there was a new image).
Some data for the site is fetched at build time from the Bioatlas (see Pre render for details). The site is therefore rebuilt and republished every night to stay accurate. This is done in two steps:
- The build workflow runs on schedule and builds and pushes a new image.
- The above mentioned cronjob in the Docker Swarm pulls the latest image and restarts the application.
This is useful for testing the image.
make build-nginx
make run-nginx
Some content and data is fetched from the Bioatlas or generated automatically at build time, before the static site is rendered by Jekyll. This is done automatically in both the development and production build process. It can also be run manually with:
make pre-render
The news index pages for different years are generated based on the actual years of the news pages in the _news folder.
Some API calls are made to the Bioatlas and the responses are saved in the _data folder.
The Ruby and Node versions used are specified in build.yml for production and in dev.Dockerfile for development.
To bump the dependecies in Gemfile and package.json run:
make bump-deps