Skip to content

Commit

Permalink
Reorganize panelite build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Apr 19, 2023
1 parent 072351b commit 67f804e
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 50 deletions.
50 changes: 0 additions & 50 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,53 +101,3 @@ jobs:
publish_dir: ./builtdocs
cname: panel.holoviz.org
force_orphan: true
deploy_jupyterlite:
name: JupyterLite
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Set and echo git ref
id: vars
run: |
echo 'Deploying from ref ${GITHUB_REF#refs/*/}'
echo 'tag=${GITHUB_REF#refs/*/}' >> $GITHUB_OUTPUT
- name: Install the dependencies
run: |
python -m pip install -r ./lite/requirements.txt
- name: Build pyodide wheels for JupyterLite
run: |
python ./scripts/build_pyodide_wheels.py lite/pypi
- name: Convert content
run: |
python ./scripts/generate_panelite_content.py
- name: Build the JupyterLite site
run: |
jupyter lite build --lite-dir lite --output-dir lite/dist
- name: Upload dev
if: |
(github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'dev') ||
(github.event_name == 'workflow_run' && (contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc')))
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.ACCESS_TOKEN }}
external_repository: pyviz-dev/panelite-dev
publish_dir: ./lite/dist
force_orphan: true
- name: Upload prod
if: |
(github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'main') ||
(github.event_name == 'push' && !(contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc')))
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.ACCESS_TOKEN }}
external_repository: pyviz-dev/panelite
publish_dir: ./lite/dist
cname: panelite.holoviz.org
force_orphan: true
74 changes: 74 additions & 0 deletions .github/workflows/jupyterlite.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: jupyterlite

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+a[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+b[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+rc[0-9]+'
workflow_dispatch:
inputs:
target:
description: 'Site to build and deploy'
type: choice
options:
- dev
- main
- dryrun
required: true
default: dryrun
schedule:
- cron: '0 19 * * SUN'

jobs:
deploy_jupyterlite:
name: JupyterLite
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Set and echo git ref
id: vars
run: |
echo 'Deploying from ref ${GITHUB_REF#refs/*/}'
echo 'tag=${GITHUB_REF#refs/*/}' >> $GITHUB_OUTPUT
- name: Install the dependencies
run: |
python -m pip install -r ./lite/requirements.txt
- name: Build pyodide wheels for JupyterLite
run: |
python ./scripts/panelite/build_pyodide_wheels.py lite/pypi
- name: Convert content
run: |
python ./scripts/panelite/generate_panelite_content.py
- name: Build the JupyterLite site
run: |
jupyter lite build --lite-dir lite --output-dir lite/dist
- name: Upload dev
if: |
(github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'dev') ||
(github.event_name == 'workflow_run' && (contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc')))
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.ACCESS_TOKEN }}
external_repository: pyviz-dev/panelite-dev
publish_dir: ./lite/dist
force_orphan: true
- name: Upload prod
if: |
(github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'main') ||
(github.event_name == 'push' && !(contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc')))
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.ACCESS_TOKEN }}
external_repository: pyviz-dev/panelite
publish_dir: ./lite/dist
cname: panelite.holoviz.org
force_orphan: true
File renamed without changes.
File renamed without changes.

0 comments on commit 67f804e

Please sign in to comment.