Skip to content

docs cleanup: custom action #168

Closed

Description

@AlexanderLanin

In order to deploy pull request previews:

Scope of issue:

  • understand whether pr-preview-action is a viable alternative to our custom action
  • implement the change

Reference: hint by @netomi at eclipse-score/.eclipsefdn#11

Activity

  1. dcalavrezo-qorix commented on Jan 29, 2025

    @dcalavrezo-qorix
    Contributor

    While pr-preview-action focuses on PR previews, our current action includes a versions file to track deployed versions.
    Since maintaining a list of all deployed versions is crucial (for traceability purposes and not only), we should implement an additional mechanism alongside pr-preview-action or we should make a comparison between deploy-version-pages and pr-preview-action and focus on improving our own action

  2. dcalavrezo-qorix commented on Jan 29, 2025

    @dcalavrezo-qorix
    Contributor

    Focusing on the differences between the two actions and ways to improve our implementation for a consolidated result

  3. AlexanderLanin commented on Jan 29, 2025

    @AlexanderLanin
    MemberAuthor

    While pr-preview-action focuses on PR previews, our current action includes a versions file to track deployed versions.

    The idea of the version file is actually to enable front-end switching of the shown version, see #250 (just created)

  4. AlexanderLanin commented on Jan 29, 2025

    @AlexanderLanin
    MemberAuthor

    Oh and I looked into creating a full blown JavaScript action a little while ago, which seems to be the gold standard. But back then I concluded that it was too much effort / overhead. Especially for the very first initial setup it was easier without JavaScript and custom logic, but simply combining exiting actions.

    Maybe you can provide an independent opinion?

    https://github.com/AlexanderLanin/versioned-pages

  5. dcalavrezo-qorix commented on Jan 31, 2025

    @dcalavrezo-qorix
    Contributor

    Current behavior

    Short review of our current action deploy-version-pages:

    1. Determine the <target_folder>

    • If triggered by a pull request (PR), the documentation is deployed under pr-<PR_NUMBER>.
    • If triggered by a branch other than main, it is deployed under a folder named after the branch (<branch_name>).
    1. Prepare the deployment directory

    • Creates a deployment folder structure (deploy_root/<target_folder>).
    • Moves the HTML files from source_folder (input) to the appropriate target directory.
    • Creates a .nojekyll file to prevent GitHub Pages from processing the folder as a Jekyll site.
    • fetches the gh-pages branch and updates the versions file by adding the new target folder (if it doesn’t already exist)
    1. Page deployment

    • Uses the github-pages-deploy-action to push the deploy_root folder to the gh-pages branch.
    • The clean: false option ensures that previous deployments are not removed, preserving existing documentation versions.
    1. Add a comment

    • If the action is triggered by a pull request, and create_comment is true, it adds a comment on the PR with a link to the generated documentation (https://eclipse-score.github.io/score/<target_folder>)

    Potential issues

    1. There are possible race conditions, when multiple PRs modify the documentation at the same time, you might not know if the correct version is pushed to the remote <target_directory>.
    2. Deleted files aren't automatically removed unless a clean-up mechanism is added. We set the clean: false setting, which means that if a file was deleted from the source_folder it will remain in the deployed documentation instead of being deleted.
    3. On a second thought, file overwrites are also possible if branches get renamed or are recreated
  6. AlexanderLanin commented on Jan 31, 2025

    @AlexanderLanin
    MemberAuthor
    1. we have a concurrency group (see docs.yaml)
  7. added a commit that references this issue on Feb 10, 2025
    97c0516
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions