Open sappelhoff opened 3 years ago
github pages websites are hosted on: <github-account-name>.github.io/<github-repo>
, e.g.: bids-standard.github.io/bids-validator/
the website is served such, that the root tree of files on the gh-pages
branch is "taken" and the index.html
file there is the landing point, see: https://github.com/bids-standard/bids-validator/tree/gh-pages
But we could also push two folders to the gh-pages
branch root: one called stable
, and one called dev
... each of these folders would look like the root does look currently
BUT ADDITIONALLY, we'll have in the root of gh-pages
an index.html that looks like this:
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1; url=https://https://bids-standard/bids-validator/stable/index.html">
<script type="text/javascript">
window.location.href = "https://https://bids-standard/bids-validator/stable/index.html"
</script>
<title>Page Redirection</title>
</head>
<body>
If you are not redirected automatically, follow this <a href='https://bids-standard/bids-validator/stable/index.html'>link</a>.
</body>
</html>
so we automatically redirect visitors to the stable
version.
And their url will look like:
instead of the current:
Finally, we need to insert some kind of button or documentation that when users replace the stable
in the URL with dev
, they are getting served the other validator.
Implementing that in CI works through "filters", telling the CI when to run a job and when not. E.g., only run it if you see a new git tag ... or run it only if there is a commit on branch XYZ
so I am pretty confident it'd work. And inserting that "button" to switch between stable and dev is the only thing I am not sure about right now
just a short note that this URL also leads to the "master" version of bids-validator: https://circleci.com/api/v1.1/project/github/bids-standard/bids-validator/latest/artifacts/0/~/web_version/index.html
will always resolve to the latest completed build.
For example, to https://8631-37161308-gh.circle-artifacts.com/0/%7E/web_version/index.html at the time of writing.
As long as we have reasonable churn, that will work, but Circle's commitment to artifact availability is pretty short-lived. I don't remember the the exact duration.
copying to this public issue from a private chat: