From f9ba4a8bca526cb66b513622b987f775aa88403e Mon Sep 17 00:00:00 2001 From: Hassan Abouelela Date: Sun, 10 Oct 2021 01:31:36 +0300 Subject: Adds Netlify Builds Adds an action which builds and uploads the static site as an artifact, and a fetch script to be run on the netlify builders. --- static-builds/README.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 static-builds/README.md (limited to 'static-builds/README.md') diff --git a/static-builds/README.md b/static-builds/README.md new file mode 100644 index 00000000..ee2c0910 --- /dev/null +++ b/static-builds/README.md @@ -0,0 +1,47 @@ +# Static Builds +This directory includes all the needed information to build and deploy static previews of the site. + +Static deployments use [django-distill](https://github.com/meeb/django-distill) to build the static content. +The content is built in GitHub Actions, and is fetched and deployed by Netlify. + + +## Instructions +These are the configuration instructions to get started with static deployments. +They are split into two parts: + +- [Building The Site](#building-the-site) +- [Deploying To Netlify](#deploying-to-netlify) + + +### Building The Site +To get started with building, you can use the following command: + +```shell +python -m pip install httpx==0.19.0 +python manage.py distill-local build --traceback --force --collectstatic +``` + +Alternatively, you can use the [Dockerfile](./Dockerfile) in this folder. + +Both output their builds to a `build/` directory. + +> Warning: If you are modifying the [build script](./netlify_build.py), make sure it is compatible with Python 3.8. + + +### Deploying To Netlify +To deploy to netlify, link your site GitHub repository to a netlify site, and use the following settings: + +Build Command: +`python -m pip install httpx==0.19.0 && python static-builds/netlify_build.py` + +Publish Directory: +`build` + +Environment Variables: +- PYTHON_VERSION: 3.8 +- TOKEN: A GitHub token with access to download build artifacts. + + +Note that at this time, if you are deploying to netlify yourself, you won't have access to the +fa-icons pack we are using, which will lead to many missing icons on your preview. +You can either update the pack to one which will work on your domain, or you'll have to live with the missing icons. -- cgit v1.2.3