Skip to main content

Static pages - Version 1.1.*

Learn how to deploy and configure a static website on EDITO using a previous version of the Static-pages service, which remains available for use.

Context


This article covers Static-pages version 1.1.5, a previous version of the service that is still available and can be used on the EDITO platform. The version number identifies the specific release documented here, as configuration options and features may differ between versions.

In this guide, you'll learn how to configure, deploy, and update your static website using Static-pages v1.1.5:

Deploy a static website


You can easily deploy a static website on your space, accessible at an address such as: https://my-custom-name.lab.dive.edito.eu

The Static-pages service allows you to host and automatically serve the files of a static website from a public or private Git repository. This service is ideal for hosting a documentation, a data visualization or any other static web content directly from your source code.

Push the required files (index.html, assets/, etc.) to a remote repository. Then, start a Static-pages service from your space on the Datalab. You will be prompted to fill in a configuration form.

💡 EDITO Pro Tip : you can save your configuration by giving it a name (1) and clicking on save (9)! Do not forget to save just before launching (10) to have the full configuration saved.

Resources (2)

Here you can define the resources on which the service will run. Your service will have at least the requested resources (1) and never more than its limits (2).

Git (3)

You now need to provide Git repository access information in the Git section (3). There are two possibilities:

  1. If your repository is public:

    1. Enable Add git config inside your environment in the Git section (3) of the form to enable internal Git configuration

    2. Provide the repository URL in Repository

  2. If your repository is private, you can add your authentication information in the corresponding fields:

    1. Name

    2. Email

    3. Token (personal access token)

By default, the service will pull files from the main branch of your repository. If you need to target a specific branch, specify its name in the Branch field.

GPU (4)

In this section, you can specify whether your service should run on a GPU. Please note that this will use a GPU from your EDITO quotas.

By default, the service will run on a CPU.

Static website files (5)

The service automatically reads the content of your index.html file:

  • If your index.html file is located in a subdirectory of the repository, specify the path in Source

  • If the files are located at the root of the repository, you can leave this field empty

Ingress Details (6)

You can customize the service URL, for example: https://my-custom-name.lab.dive.edito.eu

Environment Variables (7)

All environment variables required for the service to run properly can be defined here. Just complete the name and the value.

Building your static website (8)

In case your source files need to be built, you need to specify the path to the build script. This script shall install the tools needed to build the source files. Be aware that the script will run at every refresh of the Git files, hence it shall avoid re-installing dependencies every time.

This is an example of such a build script for a yarn-based website:

#!/usr/bin/bash

SCRIPT_DIR=$( dirname $(readlink -f "${BASH_SOURCE[0]}") )
pushd $SCRIPT_DIR > /dev/null

which node
returnValue=$?
if [ $returnValue -ne 0 ]; then
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash
\. "$HOME/.nvm/nvm.sh"
nvm install 22
echo "Node version: `node -v`"
echo "Node current version: `nvm current`"
echo "NPM version: `npm -v`"
echo "Install Yarn..."
npm install --global yarn
echo "Yarn installed"
fi

yarn --cwd /app/repository install
yarn --cwd /app/repository build

popd > /dev/null

The /app/repository is the home of your cloned repository in the running container. You can use the website source path variable specify at the service launch time if wanted, as follows app/repository/$WEBSITE_SOURCE_PATH.

Updating your website

The service automatically checks the repository for updates every 5 minutes. To trigger an immediate refresh, call the public update endpoint /update:

This will instantly fetch the latest changes from your Git repository.

Once everything is ready, don't forget to save your configuration by changing the friendly name (1) and clicking save (9).

📌 Note: the friendly name must be less than 48 characters long and can only contain “-” (dash); it cannot contain “_” (underscore) or spaces.

You can then launch (10) the tool, and your process will be visible in the Service Playground catalogue within 5 minutes.

What's next?


For the latest features and configuration options, see the latest Static-pages documentation.

If you have any questions, problems, or suggestions, please feel free to contact us via chat using the widget available at the bottom right of the page.

Did this answer your question?