Skip to content

add: CI for GitHub pages - #255

Merged
MahdiBaghbani merged 1 commit into
developfrom
mahdi/ci-gh-pages
Aug 20, 2025
Merged

add: CI for GitHub pages#255
MahdiBaghbani merged 1 commit into
developfrom
mahdi/ci-gh-pages

Conversation

@MahdiBaghbani

Copy link
Copy Markdown
Member

Based on Michiels implementation of docs.html we don't even need to build GitHub pages on spec.yaml changes since the script inside the page would fetch latest spec.

<script>
      const params = new URLSearchParams(window.location.search);
      const user = params.get('user');
      const repo = params.get('repo');
      const branch = params.get('branch');
      let changed = false;
      if (user === null) {
        params.set('user', 'cs3org');
        changed = true;
      }
      if (repo === null) {
        params.set('repo', 'OCM-API');
        changed = true;
      }
      if (branch === null) {
        params.set('branch', 'develop');
        changed = true;
      }
      if (changed) {
        params.sort();
        window.location = `?${params.toString()}`;
      }
      document.querySelector('redoc').setAttribute('spec-url', `https://raw.githubusercontent.com/${user}/${repo}/${branch}/spec.yaml`);
    </script>

@glpatcern glpatcern left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so the idea is to have the CI run on demand, but most of the time we won't even need to run it?

@MahdiBaghbani

Copy link
Copy Markdown
Member Author

Yes, we just need to run it once and then play with URL query

@MahdiBaghbani
MahdiBaghbani merged commit 21de97b into develop Aug 20, 2025
2 checks passed
@mickenordin
mickenordin deleted the mahdi/ci-gh-pages branch June 12, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants