Skip to content
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

Minor improvements #253

Merged
merged 16 commits into from
Feb 1, 2023
6 changes: 5 additions & 1 deletion .github/workflows/build_one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
conda activate base
conda install conda-libmamba-solver
conda config --set solver libmamba
- name: list files
run: doit build_list_existing_files:${{ inputs.project }}
- name: prepare project
run: doit build_prepare_project:${{ inputs.project }}
- name: process notebooks
Expand All @@ -49,6 +51,8 @@ jobs:
name: ${{ inputs.project }}
path: doc/${{ inputs.project }}/
retention-days: 3
- name: clean project folder
run: doit clean build_list_existing_files:${{ inputs.project }}
- name: deploy project
# Only push to the branch when the workflow is called by pr_flow.yml -> build.yml
# Could be updated to allow to build projects using worfklow_dispatch to see
Expand Down Expand Up @@ -90,7 +94,7 @@ jobs:
git push --force "https://pyviz-developers:${{ secrets.GITHUB_TOKEN }}@github.com/pyviz-topics/examples.git" HEAD:$BRANCHNAME
git checkout main
- name: clean up
run: doit clean --clean-dep build
run: doit clean --clean-dep build:${{ inputs.project }}
- name: git diff
run: git diff
- name: check clean up
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/deploy_one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:
- name: create project archive
run: doit doc_archive_projects --name ${{ inputs.changedproject }} --extension ".tar.bz2"
- name: validate AE5 project
env:
EXAMPLES_HOLOVIZ_STRICT_DEPLOYMENT_POLICY: "true"
run: doit ae5_validate_deployment --name ${{ inputs.changedproject }}
- name: sync and deploy on AE5
run: doit ae5_sync_project --name ${{ inputs.changedproject }}
Expand Down
41 changes: 17 additions & 24 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
########

# Runs on:
# direct push to main: checkout `evaluated` and build main site
# merged PRs: merge `tmp_evaluated_fghgf_{PRBranchName}` into`evaluated
# ,push to `evaluated` and build main site
# workflow_call (from pr_flow.yml):
# - merged PRs: merge `tmp_evaluated_fghgf_{PRBranchName}` into`evaluated
# ,push to `evaluated` and build main site
# - workflow_call (from pr_flow.yml):
# - at least one project built: pull the `tmp_evaluated_fghgf_{PRBranchName}`
# and `evaluated` branches, merge locally (NOT pushed), and build the dev site
# - no project built, checkout `evaluated` and build main site
# workflow_dispatch: checkout `evaluated` and build main or dev site
# schedule: checkout `evaluated`, don't build any site
# - workflow_dispatch: checkout `evaluated` and build main or dev site
# - schedule: checkout `evaluated`, don't build any site

name: docs

Expand Down Expand Up @@ -96,10 +95,6 @@ jobs:
if [ "${{ inputs.type }}" == "workflow_call" ]; then
NAME="${{ inputs.evaluated_branch }}"
TARGET="dev"
# Push the main, use the evaluated branch
elif [ "$EVENTNAME" == "push" ]; then
NAME="evaluated"
TARGET="main"
# Merged PRs, use the evaluated branch
elif [ "$EVENTNAME" == "pull_request" ]; then
NAME="tmp_evaluated_fghgf_${{ github.event.pull_request.head.ref }}"
Expand All @@ -109,7 +104,8 @@ jobs:
TARGET="${{ inputs.target }}"
elif [ "$EVENTNAME" == "schedule" ]; then
NAME="evaluated"
TARGET="dev"
# schedule events do not deploy a dev site, they're dry run
TARGET=""
fi
echo "Evaluated branch: $NAME"
echo "Target: $TARGET"
Expand Down Expand Up @@ -282,17 +278,20 @@ jobs:
fi
- name: archive projects
run: |
ls
cat dodo.py
doit list
doit doc_archive_projects
- name: move thumbnails
run: doit doc_move_thumbnails
- name: make assets
run: doit doc_move_assets
- name: "temp: remove non evaluated projects"
run: doit doc_remove_not_evaluated
- name: build website
- name: build dev website
if: steps.set-vars.outputs.target == 'dev'
env:
EXAMPLES_HOLOVIZ_DEV_SITE: 'true'
run: doit doc_build_website
- name: build main website
if: steps.set-vars.outputs.target == 'main'
run: doit doc_build_website
- name: build index redirects
run: doit doc_index_redirects
Expand All @@ -314,9 +313,7 @@ jobs:
- name: Deploy dev
# workflow_call, by pr_flow.yml
# workflow_dispatch and dev target
if: |
(github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'dev') ||
inputs.type == 'workflow_call'
if: steps.set-vars.outputs.target == 'dev'
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.ACCESS_TOKEN }}
Expand All @@ -326,11 +323,7 @@ jobs:
- name: Deploy main
# merged PR
# workflow_dispatch and main target
# push to main (check inputs.type as workflow_call passes its context and it's push)
if: |
github.event.pull_request.merged == true ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'main') ||
(github.event_name == 'push' && inputs.type != 'workflow_call')
if: steps.set-vars.outputs.target == 'main'
run: echo Deploy main
# TODO: uncomment this
# uses: peaceiris/actions-gh-pages@v3
Expand All @@ -340,7 +333,7 @@ jobs:
# cname: examples.pyviz.org
# force_orphan: true
- name: Clean up
run: doit clean --clean-dep doc
run: doit clean --clean-dep doc_full
- name: debug
run: |
ls -hla
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: install nbval
# TODO: latest nbval not yet available on conda-forge
# when it is, remove this and add it to the lock file
run: pip install nbval >= 0.10.0
run: pip install "nbval >= 0.10.0"
- name: validate anaconda-project file
run: doit validate_project_file:${{ inputs.project }}
- name: validate anaconda-project lock file
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,8 @@ builtdocs/
# Ignore output of test_small_data_setup
*/tmp_catalog.yml

# Ignore output of build_list_existing_files
.examples_snapshot

# dot env file to store env vars
.env
3 changes: 2 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def gallery_spec(name):
last_updated = examples_config.get('last_updated', '')
if not last_updated:
last_updated = last_commit_date(name, root='..', verbose=False)
title = examples_config.get('title', '') or projname_to_title(spec['name'])
# Default is empty string as deployments is injected into PROLOG_TEMPLATE
deployments = examples_config.get('deployments', '')

Expand All @@ -152,7 +153,7 @@ def gallery_spec(name):
# filename where the metadata prolog is injected.
endpoint += '/notebooks/{template_notebook_filename}'
elif depl['command'] == 'dashboard':
text = 'Open app'
text = 'Open app(s)'
material_icon = 'dashboard'
endpoint = deployment_cmd_to_endpoint(depl['command'], name)
formatted_depl = DEPLOYMENT_TEMPLATE.format(
Expand Down
Loading