Merge pull request #178 from mpasson/main #1721
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Install dependencies | |
env: | |
UV_SYSTEM_PYTHON: 1 | |
run: | | |
sudo apt-get install -y libglu1-mesa xvfb | |
mamba install slepc4py=*=complex* -y | |
mamba install julia | |
uv pip install . | |
uv pip install jupyter-book | |
uv pip install --upgrade jupytext | |
uv pip install gdsfactory gplugins | |
uv 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 |