-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploying dashboard as a part of an existing gh-pages site #1102
Comments
From my understanding, the deployment of the dashboard to an existing gh-pages site largely depends on how the existing gh-pages site is deployed, whether the site content is updated manually or by auto-deploy scripts, and whether the site is deployed from In the case where the existing gh-pages site is deployed based on auto-deploy scripts, the situation is a bit complicated since most likely the maintainer of the repo has to edit the existing auto-deploy script to accomodate the update of the dashboard. The exact way to achieve that may largely depend on how the existing deploy script is written and there may not be a solution that fits all situations. Nevertheless, publishing a static report onto gh-pages site is quite easy, by uploading the entire folder containing the report to the repo. However, since the report cannot get updated automatically, the use case would be quite limited. |
RepoSense provides the script for this (in https://github.com/reposense/publish-RepoSense). Hence, we just need to update that one script to support this possibility. |
I mean before adding RepoSense's deployment script, the existing gh-pages site may have its own script to publish its content (for example, using asciidoctor to convert |
You are right. Each scripts needs to be aware of the other and work accordingly. |
Good progress @niqiukun
|
I see. I will look into this. But just to check, there are still multiple repos but the GitHub page is only deployed to the main repo right? If I understand correctly, only the main repo runs CI, and changes made to other repos would not be able to automatically trigger CI of the main repo (but it won't be a problem if deployment is scheduled by cron job). |
Yes. But I should be able to update this main site without wiping out the sub-sites.
I was thinking both main and sub sites should support cron jobs or auto-deploy site if the main branch is updated. Example scenario: CS3281 is the main site, but it has a sub-site named dashboard deployed by a repo named dashboard-repo.
Not sure if we should also consider MarkBind side of things here, given that the outer site is built by MarkBind. Note that MarkBind has its own deploy command. I guess either it has to support deploying as an outer/inner site, or we have to use an alternative way to deploy a MarkBind site. We can discuss further on Thursday if the above is not clear. |
Hello, I think making deployment of the dashboard independent of the outer site that is currently utilizing the GitHub Pages may indeed be troublesome due to interference (being overridden by the outer layer static site generator). From my investigation, I realize that if we can make use of the existing support of the static site generators to include the dashboard without making further unwanted processing of the built dashboard files, then we can deploy the dashboard nicely as a static page, along with the outer site. Basically, I am treating the dashboard as a static asset that the static generators can simply copy and paste over to the build site, and it will automatically be available on the corresponding URL (just like an image or other media assets). Since we are treating it as a "static asset", most static site generators have this support built-in. Take MarkBind for example, I have created a demo here. To do it automatically, we need to ensure that the report is built in the CI before the static site generates the new site. Besides the specific details related to MarkBind, I listed two strategies below to deal with deploying the dashboard, using MarkBind as an example. Question: Do we want to have a short write-up in the UG about this way of integrating into GitHub Pages, along with a static site generator in the same repo? (Copied from the demo README) Strategy 1: Generate locally and add to version control
Strategy 2: Generate during continuous integration and deploy
In the name: CI
on:
push:
branches:
- main
schedule:
- cron: '0 0 * * *' Specifies that the CI script should run every day and also on push to the main branch. jobs:
deploy:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.8"
- name: Install dependencies
run: pip install requests
shell: bash
- name: Install Java
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Generate RepoSense
run: bash ./run.sh
shell: bash The installation and generation of the RepoSense report. - uses: actions/setup-node@v2
with:
node-version: '12'
- run: npm i -g markbind-cli
- run: markbind build
- run: markbind deploy --ci Finally, the deployment of the MarkBind site. |
Thanks for looking into this @tlylt |
That's very true. My suggested integration can't work well if the generation step takes a long time (might still work in CI to just let it run to completion behind the scene, but for larger sites indeed it might be too slow and doesn't make sense to involve the redeployment of the main site for the sake of the report). As for the navigating to the report part, I agree that the integration only took care of reducing the effort to independently host the report, but not actually making it easy to embed the report into their main site (styling wise). I think this is something that perhaps can be worked on independent of the integration, maybe something like providing an embed service similar to YouTube videos, where it's going to be iframe, but there are some styling / setup done to make the styles look fine when embedding into another site. |
The documentation explains how to set up Travis to auto-deploy the dashboard to a gh-pages site. Can we also give an option to add the dashboard as a sub-folder in an existing gh-pages site so that the dashboard doesn't always have to be a separate site?
The text was updated successfully, but these errors were encountered: