From 1de56b2c72c0711615835a5f4c295eda0a0a26ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaman=20G=C3=BC=C3=A7l=C3=BC?= Date: Thu, 6 Mar 2025 17:11:24 +0100 Subject: [PATCH 01/10] Use actions instead of gh-pages Split workflow into two sequential jobs (`build_book` and `deploy_book`), which use dedicated GitHub Actions: - `build_book` uses `configure-pages` and `upload-pages-artifact`; - `deploy_book` uses `deploy-pages`. --- .github/workflows/deploy-book.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 8eb68d6..3538903 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -7,7 +7,7 @@ on: branches: [ master ] jobs: - deploy-book: + build_book: runs-on: ${{ matrix.os }} strategy: fail-fast: true @@ -77,11 +77,22 @@ jobs: - name: Build Jupyter Book run: make docs - - name: Deploy to GitHub Pages - if: ${{ (github.ref == 'refs/heads/master') && startsWith(matrix.os, 'ubuntu') }} - run: | - pip install ghp-import - ghp-import -n -p -f _build/html - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: '_build/html' + deploy_book: + if: github.event_name != 'pull_request' + needs: build_book + runs-on: ubuntu-24.04 + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 From b8f91f605d77a452db1e752cb2ba8241be2fc5a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaman=20G=C3=BC=C3=A7l=C3=BC?= Date: Thu, 6 Mar 2025 17:53:21 +0100 Subject: [PATCH 02/10] Upload artifact from Ubuntu only --- .github/workflows/deploy-book.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 3538903..8454c56 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -78,9 +78,12 @@ jobs: run: make docs - name: Setup Pages + if: matrix.os == 'ubuntu-24.04' uses: actions/configure-pages@v5 - name: Upload artifact + if: matrix.os == 'ubuntu-24.04' + id: deployment uses: actions/upload-pages-artifact@v3 with: path: '_build/html' From 2c27d7c91f0d6b2e918b1285054ac89e07473df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaman=20G=C3=BC=C3=A7l=C3=BC?= Date: Thu, 6 Mar 2025 18:16:30 +0100 Subject: [PATCH 03/10] Rename workflow and its jobs --- .github/workflows/deploy-book.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 8454c56..b87f708 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -1,4 +1,4 @@ -name: Build IGA-Python Jupyter Book +name: IGA-Python Jupyter Book on: push: @@ -7,7 +7,7 @@ on: branches: [ master ] jobs: - build_book: + build: runs-on: ${{ matrix.os }} strategy: fail-fast: true @@ -15,15 +15,12 @@ jobs: include: - os: ubuntu-24.04 python-version: '3.12' - - os: macos-15 python-version: '3.12' - + name: build [${{ matrix.os }} / Python ${{ matrix.python-version }}] env: FC: gfortran-14 - name: ${{ matrix.os }} / Python ${{ matrix.python-version }} - steps: - uses: actions/checkout@v4 @@ -88,7 +85,7 @@ jobs: with: path: '_build/html' - deploy_book: + deploy: if: github.event_name != 'pull_request' needs: build_book runs-on: ubuntu-24.04 From 6f46bcc96b6ac08c0e7c915a24e6f0430188ee2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaman=20G=C3=BC=C3=A7l=C3=BC?= Date: Thu, 6 Mar 2025 18:19:18 +0100 Subject: [PATCH 04/10] Do not use configure-pages action --- .github/workflows/deploy-book.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index b87f708..8cb0162 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -74,10 +74,6 @@ jobs: - name: Build Jupyter Book run: make docs - - name: Setup Pages - if: matrix.os == 'ubuntu-24.04' - uses: actions/configure-pages@v5 - - name: Upload artifact if: matrix.os == 'ubuntu-24.04' id: deployment From 2ecfd8199df15b1e1344997c9cf687bd77fe63e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaman=20G=C3=BC=C3=A7l=C3=BC?= Date: Thu, 6 Mar 2025 18:21:44 +0100 Subject: [PATCH 05/10] Fix job dependency error (old name) --- .github/workflows/deploy-book.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 8cb0162..2f5906d 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -83,7 +83,7 @@ jobs: deploy: if: github.event_name != 'pull_request' - needs: build_book + needs: build runs-on: ubuntu-24.04 environment: name: github-pages From 3047a1da392ef40a983ee3ff106aeef68ab8e22e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaman=20G=C3=BC=C3=A7l=C3=BC?= Date: Thu, 6 Mar 2025 19:27:28 +0100 Subject: [PATCH 06/10] Let every build job upload its own artifact --- .github/workflows/deploy-book.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 2f5906d..876ae57 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -17,7 +17,7 @@ jobs: python-version: '3.12' - os: macos-15 python-version: '3.12' - name: build [${{ matrix.os }} / Python ${{ matrix.python-version }}] + name: build_${{ matrix.os }}_python${{ matrix.python-version }} env: FC: gfortran-14 @@ -75,12 +75,12 @@ jobs: run: make docs - name: Upload artifact - if: matrix.os == 'ubuntu-24.04' id: deployment uses: actions/upload-pages-artifact@v3 with: - path: '_build/html' - + path: _build/html + name: github-pages_${{ matrix.os }}$_python${{ matrix.python-version }}$ + deploy: if: github.event_name != 'pull_request' needs: build @@ -92,3 +92,5 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 + with: + artifact_name: github-pages_ubuntu-24.04_python3.12$ From 8ad07deb1a9acbd3c39840ff01f5eec64c66b552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaman=20G=C3=BC=C3=A7l=C3=BC?= Date: Thu, 6 Mar 2025 19:41:42 +0100 Subject: [PATCH 07/10] Remove useless dollar signs --- .github/workflows/deploy-book.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 876ae57..bf8cd28 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -79,7 +79,7 @@ jobs: uses: actions/upload-pages-artifact@v3 with: path: _build/html - name: github-pages_${{ matrix.os }}$_python${{ matrix.python-version }}$ + name: github-pages_${{ matrix.os }}_python${{ matrix.python-version }} deploy: if: github.event_name != 'pull_request' @@ -93,4 +93,4 @@ jobs: id: deployment uses: actions/deploy-pages@v4 with: - artifact_name: github-pages_ubuntu-24.04_python3.12$ + artifact_name: github-pages_ubuntu-24.04_python3.12 From 21150d26a8e196c71549088725d8d16548dba279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaman=20G=C3=BC=C3=A7l=C3=BC?= Date: Thu, 6 Mar 2025 20:40:23 +0100 Subject: [PATCH 08/10] Rename deploy-book.yml to build-deploy-book.yml Also rename the names of the workflow and the build jobs --- .github/workflows/{deploy-book.yml => build-deploy-book.yml} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{deploy-book.yml => build-deploy-book.yml} (96%) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/build-deploy-book.yml similarity index 96% rename from .github/workflows/deploy-book.yml rename to .github/workflows/build-deploy-book.yml index bf8cd28..7590a6c 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/build-deploy-book.yml @@ -1,4 +1,4 @@ -name: IGA-Python Jupyter Book +name: Jupyter book on: push: @@ -17,7 +17,7 @@ jobs: python-version: '3.12' - os: macos-15 python-version: '3.12' - name: build_${{ matrix.os }}_python${{ matrix.python-version }} + name: build / ${{ matrix.os }} / python${{ matrix.python-version }} env: FC: gfortran-14 From 60e8fd1714865d762db0efa599724e8915dd419a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaman=20G=C3=BC=C3=A7l=C3=BC?= Date: Fri, 7 Mar 2025 11:11:38 +0100 Subject: [PATCH 09/10] Add myself to project authors --- AUTHORS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index fae28c5..9f3a3d2 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,4 +1,4 @@ Ahmed Ratnani Mohamed Jalal Maaouni Paul Rigor - +Yaman Güçlü From db961485a9e639d630ffdeec6660987f37b4920f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaman=20G=C3=BC=C3=A7l=C3=BC?= Date: Fri, 7 Mar 2025 12:36:12 +0100 Subject: [PATCH 10/10] Add Contributing section to README: This mentions issues, forks, pull requests, workflows, and artifacts. --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ef03299..11681b5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Welcome to IGA-Python -This project provides a tutorial for isogeometric analysis (IGA) using Python and the Psydac library (pyccel/psydac). The numerical examples can be consulted online at pyccel.github.io/IGA-Python, or run with JupyterNotebook on a personal computer. +This project provides a tutorial for isogeometric analysis (IGA) using Python and the Psydac library (pyccel/psydac). The numerical examples can be consulted online at [pyccel.github.io/IGA-Python](https://pyccel.github.io/IGA-Python), or run with Jupyter Notebook on a personal computer. ## Editing and building IGA-Python locally @@ -70,3 +70,15 @@ nb-clean remove-filter 3. Stage the modified files with `git add`. Then run `git diff` to check if the changed `*.ipynb` notebooks doesn't include unnecessary diffs (e.g. notebook metadata). 4. `git commit` your changes. 5. *OPTIONAL*. Share your changes to this repo via a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). + +## Contributing + +There are several ways to contribute to this project. +If you find a problem, please check if this is already discussed in one of [our issues](https://github.com/pyccel/IGA-Python/issues) and feel free to add your opinion; if not, please create a [new issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/creating-an-issue). +If you want to fix an issue, improve our notebooks, or add a new example, please [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) our Git repository, make and commit your changes, and create a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) (PRs). + +All PRs are reviewed by the project maintainers. +During the PR review, GitHub workflows are triggered on various platforms. +These workflows build the notebooks and prepare them to be deployed as a static HTML website to [pyccel.github.io/IGA-Python](https://pyccel.github.io/IGA-Python). +Deploy does not happen before the final merge of the PR, but the HTML files can be downloaded as a zip file from GitHub, and opened with any browser for inspection. +To download the zip file, select the workflow run of interest from the `Actions` tab, click on `Summary`, and look under `Artifacts`. \ No newline at end of file