generated from linkml/linkml-template
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use versioned documentation deployment
These changes use mike (https://github.com/jimporter/mike) to have multiple versions of the documentation deployed. Changes to the main branch will be deployed as a "dev" version. Each release is deployed as a "MAJOR.MINOR" version -- that is, releasing 1.5.3 will replace the 1.5.2 docs. But releasing 1.6.0 will not affect the 1.5.3 docs. The latest version will also be accessible via the "latest" alias.
- Loading branch information
1 parent
448146e
commit 20cdc58
Showing
436 changed files
with
17,372 additions
and
291,174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Publish Docs & PyPI Package | ||
|
||
on: | ||
release: | ||
types: [ created ] | ||
|
||
jobs: | ||
release: | ||
name: Create release artifacts | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # fetch all commits/branches so that mike works | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1.3 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: Install dependencies | ||
run: poetry install --no-interaction | ||
|
||
- name: Build source and wheel archives | ||
run: | | ||
poetry version $(git describe --tags --abbrev=0) | ||
poetry build | ||
- name: Publish distribution to PyPI | ||
if: github.repository == 'linkml/linkml' | ||
uses: pypa/gh-action-pypi-publish@v1.2.2 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} | ||
|
||
- name: Parse version from tag | ||
id: version | ||
uses: release-kit/semver@v2 | ||
|
||
- name: Configure git user | ||
run: | | ||
git config user.name "${GITHUB_ACTOR}" | ||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
- name: Generate markdown docs from schema | ||
run: make gen-doc | ||
|
||
- name: Deploy docs | ||
if: github.event.release.prerelease == false | ||
run: | | ||
# generate HTML from markdown and put into MAJOR.MINOR version, update "latest" alias | ||
poetry run mike deploy --update-aliases ${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.x latest | ||
# copy the latest linkml_model files up to the root | ||
git checkout --force gh-pages | ||
rm -rf linkml_model | ||
cp -r latest/linkml_model . | ||
git add -A linkml_model | ||
git commit -m "Copy latest linkml_model to root level" || echo "No changes to linkml_model to commit" | ||
# copy over the latest 404.html from the tag | ||
git checkout --force ${{github.event.release.tag_name}} -- 404.html | ||
git commit -m "Add 404.html to root" || echo "No changes to 404.html to commit" | ||
# push changes to gh-page branch | ||
git push origin gh-pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!--This file is copied into the root of the documentation branch (gh-pages) after the mkdocs-generated--> | ||
<!--docs are in place. This file helps redirect paths like:--> | ||
<!-- * / => /latest--> | ||
<!-- * /docs/pattern => /latest/docs/pattern--> | ||
<!-- * /does-not-exist => /latest/404--> | ||
<!-- * /1.5.x/does-not-exist => /1.5.x/404--> | ||
|
||
<script> | ||
// Check if the current path is versioned, if not, redirect to the default versioned path | ||
const defaultVersion = "latest" | ||
const basePath = "/linkml-model" | ||
const targetRedirectPath = "404" // path to redirect to, relative to basePath | ||
|
||
const match = window.location.pathname.match(`^${basePath}/(v[0-9.]+|dev|latest)/`) | ||
if (match) { | ||
// if path starts with version, redirect to versioned 404 | ||
const versionedPath = `${basePath}/${match[1]}`; | ||
window.location.href = `${versionedPath}/${targetRedirectPath}` | ||
} else { | ||
// if path doesn't start with any version, redirect to defaultVersion | ||
window.location.href = window.location.href.replace(basePath, `${basePath}/${defaultVersion}`) | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.