Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/delete-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Delete Documentation Version

on:
delete:

permissions:
contents: write

jobs:
delete-version:
# Only run if a branch was deleted (not a tag)
if: github.event.ref_type == 'branch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install MkDocs and Mike
run: |
pip install mkdocs-material mike

- name: Configure Git User
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"

- name: Delete Version
run: |
BRANCH_NAME="${{ github.event.ref }}"

# Handle special case: if 'develop' branch is deleted (unlikely, but safe to handle)
if [ "$BRANCH_NAME" == "develop" ]; then
VERSION="dev"
else
VERSION="$BRANCH_NAME"
fi

echo "Deleting documentation version: $VERSION"

# Mike delete will fail if the version doesn't exist, so we allow failure or check first.
# We use || true to prevent the workflow from failing if the doc version didn't exist.
mike delete --push $VERSION || echo "Version $VERSION not found or already deleted."
100 changes: 100 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Deploy Documentation

on:
push:
branches:
- '**'
tags:
- 'v*'
paths:
- 'docs/**'
- 'mkdocs.yml'
- '.github/workflows/deploy-docs.yml'
workflow_dispatch:

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install MkDocs and Mike
run: |
pip install mkdocs-material mike

- name: Configure Git User
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"

- name: Deploy via Mike
run: |
# Sync README.md to docs/index.md and fix relative links
# 1. Remove the symlink (if it exists)
rm -f docs/README.md
# 2. Copy the root README.md to docs/README.md (Home page)
cp README.md docs/README.md
# 3. Fix relative links: replace 'docs/' prefix with empty string in docs/README.md
# This changes [Link](docs/file.md) -> [Link](file.md), which is correct inside docs/
sed -i 's|docs/||g' docs/README.md

# Determine Version and Alias
VERSION="${{ github.ref_name }}"
# Sanitize VERSION: replace '/' with '-' because mike/gh-pages doesn't support slashes in folder names
VERSION="${VERSION//\//-}"
ALIAS=""
HIDDEN_FLAG=""
TITLE=""

if [[ "$VERSION" == "develop" ]]; then
VERSION="dev"
ALIAS="latest"
TITLE="Development"
elif [[ "$VERSION" == "master" || "$VERSION" == "main" ]]; then
# Mapping master/main to a specific stable alias if needed, or just keeping version name
TITLE="Stable"
elif [[ "$GITHUB_REF" == refs/tags/* ]]; then
TITLE="$VERSION"
else
# For ALL other branches (feature/*, bugfix/*, or random names)
# Hide them from the dropdown key using Mike properties
HIDDEN_FLAG="--prop-set hidden=true"
TITLE="Preview: $VERSION"
fi

echo "Deploying Version: $VERSION (Title: $TITLE, Alias: $ALIAS)"

# Build arguments
ARGS="$VERSION"
[ -n "$ALIAS" ] && ARGS="$ARGS $ALIAS"
ARGS="$ARGS --title=\"$TITLE\""
[ -n "$HIDDEN_FLAG" ] && ARGS="$ARGS $HIDDEN_FLAG"

# Execute deploy
# Note: We use eval to properly handle the quoted title string
eval mike deploy --push --update-aliases $ARGS

echo "Documentation deployed."
if [ -n "$HIDDEN_FLAG" ]; then
echo "Hidden Preview URL: https://mskcc.github.io/tempo/$VERSION/"
else
echo "Public URL: https://mskcc.github.io/tempo/$VERSION/"
fi

- name: Comment on PR
if: github.ref_name != 'develop' && github.ref_name != 'master' && github.ref_name != 'main' && !startsWith(github.ref, 'refs/tags/')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
URL: https://mskcc.github.io/tempo/${{ github.ref_name }}/
run: |
gh pr comment ${{ github.ref_name }} --body "🤖 **Documentation Preview**<br>The documentation for this branch has been deployed!<br>Preview: $URL" || echo "No PR found for this branch"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ results/
*.tsv
docs/node_modules
*.pyc
site/
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

1 change: 0 additions & 1 deletion containers/multiqc/example_exome_multiqc_config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
custom_logo: 'tempoLogo.png'
custom_logo_url: 'https://ccstempo.netlify.app/'
custom_logo_title: 'CCS - Tempo'

show_analysis_paths: False
Expand Down
1 change: 0 additions & 1 deletion containers/multiqc/example_wgs_multiqc_config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
custom_logo: 'tempoLogo.png'
custom_logo_url: 'https://ccstempo.netlify.app/'
custom_logo_title: 'CCS - Tempo'

show_analysis_paths: False
Expand Down
43 changes: 0 additions & 43 deletions docs/.vuepress/config.yml

This file was deleted.

1 change: 0 additions & 1 deletion docs/.vuepress/dist/assets/css/0.styles.d4613532.css

This file was deleted.

Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion docs/.vuepress/dist/assets/img/search.83621669.svg

This file was deleted.

1 change: 0 additions & 1 deletion docs/.vuepress/dist/assets/js/10.7ae97b70.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/.vuepress/dist/assets/js/11.0fc3df68.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/.vuepress/dist/assets/js/12.0772b90f.js

This file was deleted.

Loading
Loading