Skip to content

Update dependabot.yml #233

Update dependabot.yml

Update dependabot.yml #233

Workflow file for this run

# GitHub Actions workflow for testing and continuous integration.
#
# This file performs testing using tox and tox.ini to define and configure the test environments.
name: Build and Deploy Book
on:
push:
branches:
- main # GitHub now defaults to 'main' as the name of the primary branch. Change this as needed.
tags: # run CI if specific tags are pushed
- '[0-9]+.[0-9]+.[0-9]+[a-z0-9]*' # pre-releases -- note that brackets only
# match single character, and that * does
# not mean zero or more of previous
# character.
- '[0-9]+.[0-9]+.[0-9]+' # actual releases.
pull_request:
branches: # only build on PRs against 'main'
- main
concurrency: # Cancel workflow run if a newer commit on the same branch is pushed
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Github Actions supports ubuntu, windows, and macos virtual environments:
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
build_book:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- name: Build book
os: ubuntu-latest
python: 3.11
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0
with:
miniforge-version: latest
use-mamba: true
auto-update-conda: true
channels: conda-forge
python-version: ${{ matrix.python }}
activate-environment: mamba
- name: Install base dependencies
shell: bash -l {0}
run: |
mamba install --quiet -c conda-forge astroquery ccdproc photutils=2 sphinx sphinxcontrib-bibtex jupyter-book=0.13.2
conda list
python -m pip install lxml_html_clean
conda info -e
# python -m pip install jupyter-book==0.12.1
- name: Cache
id: cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
notebooks/*.fit*.bz2
notebooks/example-cryo-LFC
notebooks/example-thermo-electric
notebooks/download_data.py
key: ${{ hashFiles('notebooks/*.fit*.bz2', 'notebooks/example-cryo-LFC', 'notebooks/example-thermo-electric', 'notebooks/download_data.py') }}
- name: Download data
if: steps.cache.outputs.cache-hit != 'true'
shell: bash -l {0}
run: |
cd notebooks
python download_data.py
- name: list directories
shell: bash -l {0}
run: |
ls -l
ls -l notebooks/
- name: Build book
shell: bash -l {0}
run: |
export GUIDE_RANDOM_SEED=4920385 # Use a seed to minimize changes in images
jb build .
- name: Upload HTML
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: rendered-book-sha-${{ github.sha }}
path: |
_build/html
deploy_html:
name: Deploy
runs-on: ubuntu-latest
needs: build_book
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'tags') }}
steps:
- name: Set version number
run: |
VERSION_NUMBER=${GITHUB_REF#refs/tags/}
if [[ "${{ github.ref }}" == 'refs/heads/main' ]]; then VERSION_NUMBER=dev; fi
echo "VERSION_NUMBER=$VERSION_NUMBER" >> $GITHUB_ENV
- name: Download artifact
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: rendered-book-sha-${{ github.sha }}
path: dev
- name: Deploy pages
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: dev
destination_dir: v/${{ env.VERSION_NUMBER }}