Skip to content

Commit

Permalink
docs: use major & minor version for docs subdir
Browse files Browse the repository at this point in the history
  • Loading branch information
kelly-sovacool committed Oct 3, 2024
1 parent dcf9687 commit 17725f1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/docs-quartodoc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# see https://github.com/rstudio/vetiver-python/blob/main/.github/workflows/docs.yml
# adapted from https://github.com/rstudio/vetiver-python/blob/main/.github/workflows/docs.yml
name: "docs"

on:
Expand Down Expand Up @@ -53,6 +53,13 @@ jobs:
run: |
# use branch name, but replace slashes. E.g. feat/a -> feat-a
echo "RELEASE_NAME=${GITHUB_REF_NAME/\//-}" >> $GITHUB_ENV
- name: set major & minor version
if: github.ref_type == 'tag' && startswith(github.ref, 'refs/tags/v')
id: version
shell: python {0}
run: from ccbr_actions.versions import get_major_minor_version
from ccbr_actions.actions import set_output
set_output('VERSION_SHORT', get_major_minor_version("${{ github.ref_name }}".lstrip("v")))
- name: publish dev docs
if: github.ref_name == 'main' && github.ref_type == 'branch'
uses: peaceiris/actions-gh-pages@v3
Expand All @@ -68,12 +75,12 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_site
publish_branch: gh-pages
destination_dir: ${{ github.ref_name }}
destination_dir: ${{ steps.version.outputs.VERSION_SHORT }}
- name: create symlink stable to new version
if: github.ref_type == 'tag' && startswith(github.ref, 'refs/tags/v')
run: |
rm -if latest
ln -s ${{ github.ref_name }} latest
ln -s ${{ steps.version.outputs.VERSION_SHORT }} latest
ls -la
git add latest
git commit -m 'chore: link latest docs to ${{ github.ref_name }}' && git push || echo 'no changes to commit'
git commit -m 'chore: link latest docs from ${{ github.ref_name }} (${{ steps.version.outputs.VERSION_SHORT }})' && git push || echo 'no changes to commit'
1 change: 1 addition & 0 deletions src/ccbr_tools/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ test = [
]
docs = [
"quartodoc >= v0.7.6",
"ccbr_actions@git+https://github.com/CCBR/[email protected]"
]

[project.scripts]
Expand Down

0 comments on commit 17725f1

Please sign in to comment.