Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The big documentation and development upgrade #1278

Closed
wants to merge 187 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
187 commits
Select commit Hold shift + click to select a range
4ce6eaf
FEAT: Easy badge updates
daquintero Oct 30, 2023
e93ce2f
FEAT: Upgraded all labels
daquintero Oct 30, 2023
eee3b5a
FEAT: A few more fun labels
daquintero Oct 30, 2023
476c363
FEAT: First draft at a pyproject.toml without poetry and dynamic config
daquintero Nov 1, 2023
c4de44b
FEAT: Backbone poetry pyproject.toml
daquintero Nov 1, 2023
c26d58d
FEAT: Pre verification tests
daquintero Nov 1, 2023
27e8759
FEAT: How equivalent is this?
daquintero Nov 1, 2023
b4a0607
FIX: Something is getting installed except the poetry.extras
daquintero Nov 1, 2023
4e8f3ad
FEAT: Working pyproject.toml base installation :rocket:
daquintero Nov 1, 2023
103384f
FEAT: Integrated old pyproject.toml into new pyproject.toml
daquintero Nov 1, 2023
388b6de
FEAT: Working core pyproject.toml installation mostly equivalent
daquintero Nov 1, 2023
598b1f0
FEAT: Upgraded to the new group dependencies vs devdependencies in po…
daquintero Nov 2, 2023
af2ef93
Removed double dev dependencies
daquintero Nov 3, 2023
5a12062
FEAT: Tests passing in python 3.10
daquintero Nov 3, 2023
d57902d
FEAT: Ready to merge
daquintero Nov 3, 2023
395a713
FEAT: Included documentation dependencies
daquintero Nov 3, 2023
94aa817
FIX: Reverified poetry build including now docs requirements and test…
daquintero Nov 3, 2023
344e515
FEAT: Upgrade tox.ini and github actions to test with poetry
daquintero Nov 3, 2023
1503e4b
FIX: Something going wrong with the poetry install
daquintero Nov 3, 2023
052596e
FIX: Something going wrong with the poetry install, integrated exampl…
daquintero Nov 3, 2023
9814957
FIX: Something going wrong with the poetry install, integrated exampl…
daquintero Nov 3, 2023
6ef064f
FIX: Something going wrong with the poetry remove support 3.7
daquintero Nov 3, 2023
b0b8bdf
FIX: Something going wrong with the poetry remove support 3.7 typo
daquintero Nov 3, 2023
9c675ee
FIX: Something going wrong with the poetry remove support below 3.10,…
daquintero Nov 3, 2023
564935e
FIX: Something going wrong with the poetry remove support below 3.10,…
daquintero Nov 3, 2023
e4fe95b
FIX: Something going wrong with the poetry remove support below 3.10,…
daquintero Nov 3, 2023
0a6a776
FIX: Sort out github actions tk envrionment from tox port
Nov 6, 2023
bb496e2
FEAT: .git scripts merge
daquinteroflex Nov 7, 2023
28509ea
FIX: Fixed pip extra install
daquinteroflex Nov 7, 2023
0a77a4b
BUG: First attempt fix python support >3.8
daquinteroflex Nov 8, 2023
c5eca3c
MERGE: First pass without notebooks
daquinteroflex Nov 8, 2023
a334d6d
FEAT: Add missing docs configuration files
daquinteroflex Nov 8, 2023
da6b7a9
FEAT: Add submodule mapping to examples
daquinteroflex Nov 8, 2023
444a3c2
FEAT: Add submodule mapping to examples
daquinteroflex Nov 8, 2023
165902c
BUG: unsure why submodule configuration not working
daquinteroflex Nov 8, 2023
2300bd6
FEAT: submodule working
daquinteroflex Nov 8, 2023
f2f754b
FEAT: Locally building docs post restructure
daquinteroflex Nov 9, 2023
74840aa
FEAT: Modify .readthedocs.yaml for poetry install
daquinteroflex Nov 9, 2023
18e0666
FEAT: Include sync action to flexcompute-readthedocs
daquinteroflex Nov 9, 2023
00adc2d
FIX: permissions to upload to this repository
daquinteroflex Nov 9, 2023
8b10ead
FIX: sync action trigger to upload to this repository
daquinteroflex Nov 9, 2023
1c3a690
FIX: sync action trigger again to upload to this repository
daquinteroflex Nov 9, 2023
0b66c45
FIX: environment extra condition
daquinteroflex Nov 9, 2023
7099007
FIX: environment extra condition why is it not running
daquinteroflex Nov 9, 2023
b36c979
FIX: environment extra condition why is it not running
daquinteroflex Nov 9, 2023
a4601bc
FIX: environment extra condition why is it not running, modified conf…
daquinteroflex Nov 9, 2023
f8c15d9
FIX: environment extra condition why is it not running, modified conf…
daquinteroflex Nov 9, 2023
0398f63
BUG: Why are you not authenticating?
daquinteroflex Nov 10, 2023
11fc051
FIX: .readthedocs.yaml setup, the pain of temp tools, so much pain
daquinteroflex Nov 10, 2023
637bdbc
Merge branch 'docs_improvement_suggestions' into develop
daquinteroflex Nov 10, 2023
7f4d6a3
FEAT: Project structure cleanup temp
daquinteroflex Nov 10, 2023
fbc13c7
FIX: Does this sort out the notebooks build?
daquinteroflex Nov 10, 2023
1404124
FEAT: Updated the action try again
daquinteroflex Nov 10, 2023
2192efd
FEAT: Updated the action try again
daquinteroflex Nov 10, 2023
2f3b3c9
FIX: Turns out github secrets don't get passed on pull requests
daquinteroflex Nov 10, 2023
1a3f972
FIX: Turns out github secrets don't get passed on pull requests, reve…
daquinteroflex Nov 10, 2023
8ec268f
FEAT: Upgraded sphinx theme
daquinteroflex Nov 10, 2023
ebba217
FIX: sphinx theme upgrade
daquinteroflex Nov 10, 2023
1ad5d4c
BUG: Still same issue but refactoring happening, turns out it never c…
daquinteroflex Nov 13, 2023
952e1d3
BUG: Let's start from scratch to see if this builds now
daquinteroflex Nov 13, 2023
bc4ca31
BUG: Let's start from scratch to see if this builds now, save old ver…
daquinteroflex Nov 13, 2023
14c4068
FIX: Making progress on new configuration
daquinteroflex Nov 13, 2023
149d175
FIX: First build
daquinteroflex Nov 13, 2023
93a081c
FIX: First build
daquinteroflex Nov 13, 2023
57a7943
FEAT: Looking alright in progress
daquinteroflex Nov 13, 2023
2b8d4eb
FEAT: Making structure nicer
daquinteroflex Nov 14, 2023
b890396
FEAT: Things moving but why not working top page
daquinteroflex Nov 14, 2023
b00b3c0
FEAT: Reproducible pyproject.toml sphinx build
daquinteroflex Nov 15, 2023
3155878
FEAT: Starting off making develop helper commands
daquinteroflex Nov 15, 2023
6a05c9e
FEAT: Starting off making develop helper commands
daquinteroflex Nov 15, 2023
25a64a3
FEAT: Files moved properly
daquinteroflex Nov 15, 2023
c678871
FEAT: Ready for directory restructure
daquinteroflex Nov 15, 2023
ed1a46e
REFACTOR: Something is surely broken
daquinteroflex Nov 15, 2023
33cb297
BUG: Sphinx building but massive refactor
daquinteroflex Nov 15, 2023
e84e9b6
FEAT: Environment verificaiton and configuration scripts in progress
daquinteroflex Nov 15, 2023
68a276a
FEAT: Environment verificaiton and configuration scripts alright
daquinteroflex Nov 15, 2023
69ba20a
FEAT: Working docs build script
daquinteroflex Nov 15, 2023
f991a70
FEAT: Test double repository commit
daquinteroflex Nov 15, 2023
f3189d3
Merge branch 'sphinx_upgrade' into repo_merge_no_history
daquinteroflex Nov 15, 2023
53bd825
FEAT: Moving on to another computer
daquinteroflex Nov 16, 2023
9833f44
FEAT: Start poetry developer flow documentation
daquintero Nov 16, 2023
f606e49
Merge branch 'repo_merge_no_history' of https://github.com/daquintero…
daquintero Nov 16, 2023
112d83d
BUG: Testing installation scripts, am unhappy with them
daquintero Nov 17, 2023
f17e9e5
FEAT: Advancing on poetry development documentation
daquintero Nov 17, 2023
5d6243b
FEAT: Modify to new submodule git repo home
daquintero Nov 17, 2023
9b195e6
FEAT: Further development documentation
daquintero Nov 17, 2023
918f2f6
FIX: .readthedocs.yaml for new structure
daquintero Nov 17, 2023
46c84c5
FIX: new submodule path
daquintero Nov 17, 2023
3f52b01
BUG: Issue with .gitignore not including development files
daquinteroflex Nov 20, 2023
cdb36e0
BUG: Issue with .gitignore not including development files
daquinteroflex Nov 20, 2023
514d3bd
FEAT: Including development documentation now
daquinteroflex Nov 20, 2023
bee02e7
FEAT: Testing submodule now
daquinteroflex Nov 20, 2023
2ecd717
FEAT: Further equivalence and dark theme included
daquinteroflex Nov 20, 2023
beca78c
FEAT: Further equivalence on versioning
daquinteroflex Nov 20, 2023
e16d6bd
BUG: Need to sort out the sitemap situation
daquinteroflex Nov 20, 2023
7c70bc9
FEAT: Let's try these fonts
daquinteroflex Nov 20, 2023
c090670
FEAT: Get a full build going on
daquinteroflex Nov 20, 2023
c2e5a50
FEAT: How is this looking like?
daquinteroflex Nov 20, 2023
a859e4d
FEAT: How is this looking like?
daquinteroflex Nov 20, 2023
215bfb3
FEAT: The sphinx warning purge begins
daquinteroflex Nov 21, 2023
ceb255b
FEAT: Trying to guarantee equivalence
daquinteroflex Nov 21, 2023
f1d4275
BUG: Again the sitemap issue.
daquinteroflex Nov 21, 2023
af74a58
FIX: Are the sitemaps working?
daquinteroflex Nov 21, 2023
9af0458
FEAT: this doesnt work
daquinteroflex Nov 22, 2023
9ab5f32
So we've got the gist here on autodoc_pydantic, but the question is w…
daquinteroflex Nov 22, 2023
f3031a0
FEAT: Getting better I think, but missing information.
daquinteroflex Nov 22, 2023
87cbcf4
FEAT: Does this make it any better?
daquinteroflex Nov 22, 2023
bff4479
FEAT: I am unconvinced
daquinteroflex Nov 22, 2023
93937bc
FEAT: Beginning to get rid of autodoc_pydantic
daquinteroflex Nov 23, 2023
2f35504
FEAT: Beginning to get rid of autodoc_pydantic
daquinteroflex Nov 23, 2023
d695683
FEAT: Beginning to get rid of autodoc_pydantic
daquinteroflex Nov 23, 2023
13e9c09
FEAT: Bye bye autodoc_pydantic
daquinteroflex Nov 23, 2023
936ae76
FEAT: This looks kind of nice
daquinteroflex Nov 23, 2023
d7f525d
FEAT: This looks kind of nice
daquinteroflex Nov 23, 2023
d15e554
FEAT: This looks kind of nice
daquinteroflex Nov 23, 2023
66d5be8
FEAT: Attempting to implement better function parameter parsing
daquinteroflex Nov 24, 2023
cfe3b5f
FEAT: API docs are much prettier
daquinteroflex Nov 24, 2023
c5a0f80
FEAT: Working image in docstring example
daquinteroflex Nov 24, 2023
0f4667d
FEAT: Working image in docstring example, fix idiot rtd bug
daquinteroflex Nov 24, 2023
e6b65e2
FEAT: Working image in docstring example, fix idiot rtd bug, fix docs…
daquinteroflex Nov 24, 2023
332b3c5
FEAT: Doesn't look too bad
daquinteroflex Nov 27, 2023
f5b458d
FEAT: I like how it is looking
daquinteroflex Nov 27, 2023
9cc532e
FEAT: Looking professional, now got to do this with all the API/noteb…
daquinteroflex Nov 27, 2023
f66415d
FEAT: All these API/quickstart links are beautiful
daquinteroflex Nov 27, 2023
45098a8
FEAT: Why was the submodule not syncing?
daquinteroflex Nov 27, 2023
1ba46ee
BUG: What is happening with the submodule
daquinteroflex Nov 27, 2023
8e1f286
BUG: What is happening with the submodule
daquinteroflex Nov 27, 2023
415f4dc
FIX: Does this sort out the submodule bug
daquinteroflex Nov 27, 2023
af4cafa
FEAT: Test build with api links done
daquinteroflex Nov 29, 2023
66614d4
FEAT: Issues sorting out docs
daquinteroflex Nov 29, 2023
b807ac0
FEAT: Sorted out the first set of docstring formatting
daquinteroflex Nov 30, 2023
b271968
FEAT: Further improved linked docs
daquinteroflex Nov 30, 2023
cd6cc25
FEAT: Verified conf py equivalence
daquinteroflex Nov 30, 2023
8e4b6ca
TODO: Restructured actions based on issue, pending submodule sync on …
daquinteroflex Nov 30, 2023
b202bb1
FEAT: Improved links formatting
daquinteroflex Nov 30, 2023
c9dd34d
FEAT: Further docs improvements
daquinteroflex Dec 1, 2023
801a54b
FEAT: Pre plugin docs restructure
daquinteroflex Dec 1, 2023
c8122e3
FEAT: Further changes before pycharm crash
daquinteroflex Dec 1, 2023
f8d6266
FEAT: PML is looking really nice
daquinteroflex Dec 1, 2023
dd4d207
FEAT: Further dispersion docs based on lecture 5
daquinteroflex Dec 4, 2023
c2d0b56
FEAT: Simulation api restructure pre lecture 7-10
daquinteroflex Dec 4, 2023
cd6caf2
FEAT: Further docs improvements across
daquinteroflex Dec 4, 2023
0bf42af
FEAT: Further documentation
daquinteroflex Dec 4, 2023
a3132ff
FEAT: Further links throughout
daquinteroflex Dec 5, 2023
08166f7
FEAT: courant on simulation is looking nice
daquinteroflex Dec 5, 2023
e229843
FEAT: Improving simulation docs needs a bit of aesthetics
daquinteroflex Dec 5, 2023
aaff423
FEAT: Subpixel more advanced on simulation
daquinteroflex Dec 6, 2023
5103521
FEAT: Sort out the demo build before I raise issue
daquinteroflex Dec 6, 2023
0ea2f4b
FEAT: Push further example information
daquinteroflex Dec 6, 2023
5bd7dd8
FEAT: Not so bad but can be better
daquinteroflex Dec 6, 2023
63136dd
FEAT: This looks so much better
daquinteroflex Dec 6, 2023
2d1cef1
FEAT: This needs a massive cleanup but more FAQ into API added
daquinteroflex Dec 7, 2023
898485c
MERGE: issue
daquinteroflex Dec 7, 2023
416e40b
FEAT: Cleanup docstrings from a-mode
daquinteroflex Dec 11, 2023
b1eefa4
FEAT: I don't like these table lines
daquinteroflex Dec 11, 2023
dfb9b6d
FEAT: Latex not compiling I think it has to do with docstrings refere…
daquinteroflex Dec 11, 2023
d6f7ac7
FEAT: Pre third pass review
daquinteroflex Dec 12, 2023
fc6fd39
FEAT: Second pass post full review
daquinteroflex Dec 12, 2023
2bb62dc
FEAT: Inherited classes added?
daquinteroflex Dec 12, 2023
bd77013
FEAT: A bit better development environment installation flow
daquinteroflex Dec 13, 2023
44bd2d5
FEAT: Sorting out colors with marketing now
daquinteroflex Dec 13, 2023
c3ba9f4
FEAT: Maybe we need to PR to the sphinx theme to add our custom noteb…
daquinteroflex Dec 13, 2023
c50c94a
FEAT: Further upgrades including collab
daquinteroflex Dec 13, 2023
261b7ca
PULL: pre2.5 and fix conflicts
daquinteroflex Dec 14, 2023
298847b
FEAT: All tests passing and updated version to 2.6.0rc1
daquinteroflex Dec 14, 2023
c58601b
BUG: Decide what to do with make_script
daquinteroflex Dec 14, 2023
c0bc622
FIX: Docs are building again, broken links everywhere
daquinteroflex Dec 14, 2023
36c1b3e
FIX: Does windows run now?
daquinteroflex Dec 14, 2023
deb81ac
FIX: Does windows run now?
daquinteroflex Dec 14, 2023
47e14ae
FEAT: Maybe this sorts out windows
daquinteroflex Dec 14, 2023
b66cbb7
FIX: Does this sort it?
daquinteroflex Dec 14, 2023
27f1786
FIX: Try again
daquinteroflex Dec 14, 2023
6ab2a27
FEAT: What if we don't add lockfile?
daquinteroflex Dec 14, 2023
7b5f923
FIX: Try again
daquinteroflex Dec 14, 2023
9863c5d
TEMP: Ignore some ruff warnings to check build
daquinteroflex Dec 14, 2023
cbc470d
FIX: Please build on windows
daquinteroflex Dec 14, 2023
f86ec06
FEAT: Setting again to original jax logic
daquinteroflex Dec 14, 2023
456d48f
FEAT: Try again with jaxwindows source added
daquinteroflex Dec 14, 2023
4ad6d16
FIX: All jax pacakges have jaxsource added
daquinteroflex Dec 14, 2023
3b0b6b7
FIX: All jax pacakges have jaxsource added
daquinteroflex Dec 14, 2023
ff09f67
FIX: Added PEP530 compliant sources poetry recognises
daquinteroflex Dec 14, 2023
f3591f7
FIX: Apparently try a new source
daquinteroflex Dec 15, 2023
5bd905d
FIX: Minor typo maybe it works now
daquinteroflex Dec 15, 2023
368705d
FIX: Minimum requirement might need to be increased for CPU post py11…
daquinteroflex Dec 15, 2023
2f147a3
FIX: Minimum requirement py39? and higher jaxlib/jax versions
daquinteroflex Dec 15, 2023
77c2869
FEAT: Rewrite poetry.lock and clean pyproject.toml
daquinteroflex Dec 15, 2023
3e765a8
FEAT: Include abstract models
daquinteroflex Dec 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .binder/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tidy3d
tmm
nlopt
tqdm
gdspy
11 changes: 10 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# Linguist-vendored files
docs/* linguist-vendored
notebooks/* linguist-vendored
tests/* linguist-vendored

# Disable linguist detection for IPython notebooks
*.ipynb linguist-detectable=false

# Mark IPython notebooks as generated files
*.ipynb linguist-generated=true

CHANGELOG.md merge=union
# Specify merge attributes for CHANGELOG.md
CHANGELOG.md merge=union

# Specify diff and merge attributes for IPython notebooks
*.ipynb diff=jupyternotebook
*.ipynb merge=jupyternotebook
13 changes: 13 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[diff "jupyternotebook"]
command = git-nbdiffdriver diff
[merge "jupyternotebook"]
driver = git-nbmergedriver merge %O %A %B %L %P
name = jupyter notebook merge driver
[difftool "nbdime"]
cmd = git-nbdifftool diff \"$LOCAL\" \"$REMOTE\" \"$BASE\"
[difftool]
prompt = false
[mergetool "nbdime"]
cmd = git-nbmergetool merge \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
[mergetool]
prompt = false
56 changes: 48 additions & 8 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,70 @@ name: Tidy3dTests
on:
workflow_dispatch:
push:
branches: [ develop ]
branches: [ development ]
pull_request:
branches:
- develop
- development
- 'pre/*'
- poetry_upgrade

jobs:
build:
name: test ${{ matrix.python-version }} - ${{ matrix.platform }}
runs-on: ${{ matrix.platform }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11']
platform: [ubuntu-latest, macos-latest, windows-latest]
defaults:
run:
shell: bash
env: # Set environment variables for the whole job
PIP_FIND_LINKS: https://whls.blob.core.windows.net/unstable/index.html
PIP_ONLY_BINARY: gdstk
MPLBACKEND: agg
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.6.1
virtualenvs-create: true
virtualenvs-in-project: true
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root -E dev
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction -E dev
#----------------------------------------------
# add matrix specifics and run test suite
#----------------------------------------------
- name: Run tests
run: |
python -m pip install --upgrade pip
pip install tox-gh-actions
pip install tox
- name: Test with tox
run: tox
source $VENV
black . --check --diff
ruff check tidy3d --fix --exit-non-zero-on-fix
pytest -rA tests
pytest -rA tests/test_data/_test_datasets_no_vtk.py
70 changes: 70 additions & 0 deletions .github/workflows/sync-to-proxy-repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: sync-to-proxy-repo
on:
push:
branches:
- main
- latest
workflow_dispatch:
inputs:
env:
description: environment
default: dev
required: true
jobs:
set_env:
outputs:
env: ${{ steps.setenv.outputs.env }}
dest-branch: ${{ steps.dest-branch.outputs.branch }}
runs-on: ubuntu-latest
steps:
- id: setenv
run: |
if test -n "${{ github.event.inputs.env }}"
then
echo "::set-output name=env::${{ github.event.inputs.env }}"
echo "ENV=${{ github.event.inputs.env }}" >> $GITHUB_ENV
fi
if test "${{ github.event_name }}" = 'push' -a "${{ github.ref }}" = 'refs/heads/latest'
then
echo "::set-output name=env::dev"
echo "ENV=dev" >> $GITHUB_ENV
fi
if test "${{ github.event_name }}" = 'push' -a "${{ github.ref }}" = 'refs/heads/main'
then
echo "::set-output name=env::prod"
echo "ENV=prod" >> $GITHUB_ENV
fi
- id: dest-branch
run: |
case ${{ env.ENV }} in
dev)
echo "::set-output name=branch::develop"
;;
prod)
echo "::set-output name=branch::main"
;;
esac
build-and-deploy:
needs: set_env
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/notebooks/
token: ${{ secrets.GH_PAT }}
repository-name: flexcompute/tidy3d-example-library
target-folder: notebooks
branch: ${{ needs.set_env.outputs.dest-branch }}
- run: |
mkdir -p build_toc
cp docs/examples.rst build_toc/examples.rst

- uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build_toc
token: ${{ secrets.GH_PAT }}
repository-name: flexcompute/tidy3d-example-library
target-folder: toc
branch: ${{ needs.set_env.outputs.dest-branch }}
63 changes: 63 additions & 0 deletions .github/workflows/sync-to-readthedocs-repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: sync-to-readthedocs-repo
permissions:
contents: write
on:
push:
branches:
- main
- latest
- repo_merge_no_history
workflow_dispatch:
inputs:
env:
description: environment
default: dev
required: true
jobs:
set_env:
outputs:
env: ${{ steps.setenv.outputs.env }}
dest-branch: ${{ steps.dest-branch.outputs.branch }}
runs-on: ubuntu-latest
steps:
- id: setenv
run: |
if test -n "${{ github.event.inputs.env }}"
then
echo "::set-output name=env::${{ github.event.inputs.env }}"
echo "ENV=${{ github.event.inputs.env }}" >> $GITHUB_ENV
elif test "${{ github.event_name }}" = 'push' -a "${{ github.ref }}" = 'refs/heads/latest'
then
echo "::set-output name=env::dev"
echo "ENV=dev" >> $GITHUB_ENV
elif test "${{ github.event_name }}" = 'push' -a "${{ github.ref }}" = 'refs/heads/main'
then
echo "::set-output name=env::prod"
echo "ENV=prod" >> $GITHUB_ENV
else
echo "::set-output name=env::dev"
echo "ENV=dev" >> $GITHUB_ENV
fi
- id: dest-branch
run: |
case ${{ env.ENV }} in
dev)
echo "::set-output name=branch::repo_merge_no_history"
;;
prod)
echo "::set-output name=branch::main"
;;
esac
build-and-deploy:
needs: set_env
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: JamesIves/github-pages-deploy-action@v4
with:
folder: .
token: ${{ secrets.GH_PAT }}
repository-name: flexcompute-readthedocs/tidy3d-docs-demo
target-folder: .
branch: ${{ needs.set_env.outputs.dest-branch }}
104 changes: 104 additions & 0 deletions .github/workflows/sync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: build&sync
on:
workflow_dispatch:
inputs:
env:
description: environment
default: dev
required: true
jobs:
set_env:
outputs:
env: ${{ steps.setenv.outputs.env }}
dest-branch: ${{ steps.dest-branch.outputs.branch }}
runs-on: ubuntu-latest
steps:
- id: setenv
run: |
if test -n "${{ github.event.inputs.env }}"
then
echo "::set-output name=env::${{ github.event.inputs.env }}"
echo "ENV=${{ github.event.inputs.env }}" >> $GITHUB_ENV
fi
if test "${{ github.event_name }}" = 'push' -a "${{ github.ref }}" = 'refs/heads/develop'
then
echo "::set-output name=env::dev"
echo "ENV=dev" >> $GITHUB_ENV
fi
if test "${{ github.event_name }}" = 'push' -a "${{ github.ref }}" = 'refs/heads/main'
then
echo "::set-output name=env::prod"
echo "ENV=prod" >> $GITHUB_ENV
fi
- id: dest-branch
run: |
case ${{ env.ENV }} in
dev)
echo "::set-output name=branch::develop"
;;
prod)
echo "::set-output name=branch::main"
;;
esac
build-and-deploy:
needs: set_env
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: echo environment
run: |
echo "::notice ::env:${{needs.set_env.outputs.env}}"
echo "::notice ::dest-branch:${{needs.set_env.outputs.dest-branch}}"
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- run: cd ${{ github.workspace }}/docs && pip install beautifulsoup4 nbformat nbconvert pyyaml
- run: cd ${{ github.workspace }}/docs/notebooks && mkdir html && python convert.py
- shell: bash
run: |
cd ${{ github.workspace }}
mkdir -p build && rsync -r ${{ github.workspace }}/docs/notebooks/html/ build
mkdir -p build/css && rsync -r build/css/ build-css
mkdir -p build/image && rsync -r build/image/ build-image
mkdir -p build-source && cp docs/source/notebooks/*.ipynb build-source
rm -rf build/css
rm -rf build/image
ls -la build

- uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build
token: ${{ secrets.GH_PAT }}
repository-name: cmsflexc/flexcompute.com
target-folder: tidy3d/examples/notebooks
branch: ${{ needs.set_env.outputs.dest-branch }}
- uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build-css
token: ${{ secrets.GH_PAT }}
repository-name: cmsflexc/flexcompute.com
target-folder: /assets/tidy3d/examples/css
branch: ${{ needs.set_env.outputs.dest-branch }}
- uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build-image
token: ${{ secrets.GH_PAT }}
repository-name: cmsflexc/flexcompute.com
target-folder: /assets/tidy3d/examples/image
branch: ${{ needs.set_env.outputs.dest-branch }}
- uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build-source
token: ${{ secrets.GH_PAT }}
repository-name: cmsflexc/flexcompute.com
target-folder: /assets/tidy3d/examples/notebooks
branch: ${{ needs.set_env.outputs.dest-branch }}
- uses: actions/upload-artifact@v3
with:
name: output
path: build/
retention-days: 7
Loading
Loading