Skip to content

docs

docs #1544

Workflow file for this run

name: docs
on:
push:
pull_request:
schedule:
- cron: "1 8 * * *"
jobs:
build:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Get Date
id: get-date
run: |
echo "date=$(/bin/date --date='TZ="America/Los_Angeles"' -u "+%Y%m%d")" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
- uses: actions/checkout@v4
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
activate-environment: env
use-mamba: true
python-version: "3.12"
- name: Add conda to system path
run: |
echo $CONDA/bin >> $GITHUB_PATH
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.1
virtualenvs-create: false
installer-parallel: true
- name: Install dependencies
run: |
sudo apt-get install -y libglu1-mesa xvfb
poetry install --no-interaction
pip install --upgrade scipy
mamba install slepc4py=*=complex* -y
mamba install julia
pip install jupyter-book
pip install --upgrade jupytext
pip install gdsfactory gplugins
pip list
- uses: julia-actions/setup-julia@v2
with:
version: '1.10.3'
- uses: julia-actions/cache@v2
with:
cache-name: ${{ runner.os }}-${{ steps.get-date.outputs.date }}
cache-compiled: "true"
- uses: julia-actions/julia-buildpkg@v1
- name: Install julia dependencies
run: |
pip install juliacall
julia -e 'using Pkg; Pkg.add("PythonCall")'
- name: Precompile julia dependencies
continue-on-error: true
run: |
julia --project=~/work/femwell/femwell -e 'using Pkg; Pkg.precompile()'
- uses: actions/cache@v4
with:
path: |
docs/_build/.jupyter_cache
key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-${{ steps.get-date.outputs.date }}
- name: Make docs
run: |
PYTHON_JULIAPKG_PROJECT=~/work/femwell/femwell PYTHON_JULIAPKG_OFFLINE=yes jupyter-book build docs/
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './docs/_build/html/'
deploy:
if: ${{ github.repository == 'HelgeGehring/femwell' && github.ref == 'refs/heads/main' }} # skip for forks / branches
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
#trigger-binder-build:
# runs-on: [ubuntu-latest]
# steps:
# - uses: s-weigand/trigger-mybinder-build@v1
# with:
# target-repo: HelgeGehring/femwell
# target-state: HEAD
# service-name: gh
# debug: true