Skip to content

gallery

gallery #273

Workflow file for this run

name: gallery
on:
workflow_run: # zizmor: ignore[dangerous-triggers]
workflows: [packages]
types:
- completed
workflow_dispatch:
inputs:
target:
description: "Build and deploy gallery"
type: choice
options:
- dev
- main
- dryrun
required: true
default: dryrun
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
deploy_gallery:
name: Gallery
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.11"
- name: Set and echo git ref
id: vars
env:
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
run: |
echo "Deploying from ref $HEAD_BRANCH"
echo "tag=$HEAD_BRANCH" >> $GITHUB_OUTPUT
- uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4
with:
miniconda-version: "latest"
auto-update-conda: true
- name: Install dependencies
run: |
conda activate test
conda install -c ae5-admin anaconda-project ae5-tools
- name: Prepare environment to check it solves
run: |
anaconda-project prepare --directory examples/gallery
git clean -fxd examples/gallery
git reset --hard "$GITHUB_SHA"
- name: Upload and deploy dev gallery
if: |
github.event_name != 'schedule' &&
(
(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')))
)
env:
TAG: ${{ steps.vars.outputs.tag || '0.0.1dev' }}
run: |
conda activate test
ae5 login --hostname holoviz-demo.anaconda.com --username ${{ secrets.AE5_USERNAME }} --password ${{ secrets.AE5_PASSWORD }}
ae5 deployment stop lumen-gallery-dev --yes || :
ae5 project delete lumen-gallery-dev --yes || :
ae5 project upload examples/gallery --name lumen-gallery-dev --tag "${TAG}"
ae5 deployment start lumen-gallery-dev --endpoint lumen-gallery-dev --command default --public --command default --resource-profile default --wait
- name: Upload and deploy prod gallery
if: |
github.event_name != 'schedule' &&
(
(github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'main') ||
(github.event_name == 'workflow_run' && !(contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc')) && contains(steps.vars.outputs.tag, 'v'))
)
env:
TAG: ${{ steps.vars.outputs.tag }}
run: |
conda activate test
ae5 login --hostname holoviz-demo.anaconda.com --username ${{ secrets.AE5_USERNAME }} --password ${{ secrets.AE5_PASSWORD }}
ae5 deployment stop lumen-gallery --yes || :
ae5 project delete lumen-gallery --yes || :
ae5 project upload examples/gallery --name lumen-gallery --tag "${TAG}"
ae5 deployment start lumen-gallery --endpoint lumen-gallery --command default --public --command default --resource-profile large --wait