diff --git a/README.md b/README.md index 3ff6c5d80ffd0cd390e03a6733ae583e38c8a043..0ea59736965181ea5e8fbaf70b1807d2133ad2b6 100644 --- a/README.md +++ b/README.md @@ -70,3 +70,65 @@ Deployment of the documentation to GitLab Pages is managed through a CI/CD pipel **Important**: Certain parts of the pipeline, including the commit and deploy stages, are only run on the `main` branch. This ensures that only finalized and approved changes are deployed to the live documentation site. The pipeline will automatically build and deploy the documentation to GitLab Pages upon successful completion of all stages. + +## Versioning + +The documentation supports the deployment of multiple pages for different versions. This is done via parallel deployments. +The way these parallel pages are to be deployed is as follows. +The main branch of the project is always the newest, not-yet-published page. Here we can slowly keep adding more and more content. +This branch should never be deployed. Only upon new release can we deploy this new page. +For that, we are going to create a new branch named after the release name, and this new branch is what we are going to release. +**The main page is always the newest published branch.** + +The main difference between the main page of docs and paraller is that paraller has a postfix in the URL and is thus not the primary site. +When setting up the version, you need to make a few adjustments to the gitlab-ci.yml. + +### Parallel page setup from the main page + +In the file `gitlab-ci.yml` the following lines need to be added under the `pages` stage when creating a new parallel page from the main page: +``` + pages: + path_prefix: "$CI_PIPELINE_ID" + expire_in: never +``` + +This means that this new page will have a postfix in the link that is the same as the name of the release. +This means that a new page will be generated under the URL: https://inject.pages.fi.muni.cz/{release-name} + +You also need to specify the expiration time of this deployment since, by default, they are set to expire in a set amount of time. + +### Setup shared for all versions + +Another part that needs to be adjusted for each page upon new release is the menu for switching versions. +It's located in `overrides/partials/header.html`. Here you can find the lines: +``` + <!-- Dropdown Menu for Page Versions --> + <div class="md-header__dropdown"> + <select onchange="window.location.href=this.value;"> + <option value="#">Citadel</option> + <option value="/bastion/">Bastion</option> + </select> + </div> +``` + +On a parallel page, it looks like: +``` + <!-- Dropdown Menu for Page Versions --> + <div class="md-header__dropdown"> + <select onchange="window.location.href=this.value;"> + <option value="#">Bastion</option> + <option value="../">Citadel</option> + </select> + </div> +``` + +When adding a new page, you will need to add a new option to this list. A few things to mention are: +* value="#" points to the page where the user is currently +* value="/" points to the main page from the parallel page +* value="/{branch-name}/" points to a parallel page + +### Tip + +To avoid accidental publishing, the tag `only:` should always be set to the name of the branch where it is located. +Also, the main branch should never have a valid gitlab-ci.yml that can publish pages. +For that reason the tag `only:` on the main branch of the project should be set to a different name other than the main branch. \ No newline at end of file