Skip to content

Commit b45beb5

Browse files
authored
Use actions instead of gh-pages branch (#13)
Split the workflow into two sequential jobs (`build` and `deploy`), which use dedicated GitHub Actions: - The `build` job matrix builds our HTML documentation for GitHub Pages, then it uploads artifacts with job-dependent names using `upload-pages-artifact`. Hence the generated books can be checked during a PR review. This fixes #12. - The `deploy` job runs on a single platform after the PR is merged. It deploys the correct artifact to GitHub Pages using `deploy-pages`. NOTE: We do not need a dedicated branch `gh-pages` any longer. Other changes: - Rename `build-book.yml` to `build-deploy-book.yml` - Rename workflow and build jobs - Add `Contributing` section to `README.md`, which mentions issues, forks, pull requests, workflows, and artifacts. - Add myself to `AUTHORS`.
1 parent af9b857 commit b45beb5

File tree

3 files changed

+36
-15
lines changed

3 files changed

+36
-15
lines changed
Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build IGA-Python Jupyter Book
1+
name: Jupyter book
22

33
on:
44
push:
@@ -7,23 +7,20 @@ on:
77
branches: [ master ]
88

99
jobs:
10-
deploy-book:
10+
build:
1111
runs-on: ${{ matrix.os }}
1212
strategy:
1313
fail-fast: true
1414
matrix:
1515
include:
1616
- os: ubuntu-24.04
1717
python-version: '3.12'
18-
1918
- os: macos-15
2019
python-version: '3.12'
21-
20+
name: build / ${{ matrix.os }} / python${{ matrix.python-version }}
2221
env:
2322
FC: gfortran-14
2423

25-
name: ${{ matrix.os }} / Python ${{ matrix.python-version }}
26-
2724
steps:
2825
- uses: actions/checkout@v4
2926

@@ -77,11 +74,23 @@ jobs:
7774
- name: Build Jupyter Book
7875
run: make docs
7976

77+
- name: Upload artifact
78+
id: deployment
79+
uses: actions/upload-pages-artifact@v3
80+
with:
81+
path: _build/html
82+
name: github-pages_${{ matrix.os }}_python${{ matrix.python-version }}
83+
84+
deploy:
85+
if: github.event_name != 'pull_request'
86+
needs: build
87+
runs-on: ubuntu-24.04
88+
environment:
89+
name: github-pages
90+
url: ${{ steps.deployment.outputs.page_url }}
91+
steps:
8092
- name: Deploy to GitHub Pages
81-
if: ${{ (github.ref == 'refs/heads/master') && startsWith(matrix.os, 'ubuntu') }}
82-
run: |
83-
pip install ghp-import
84-
ghp-import -n -p -f _build/html
85-
env:
86-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87-
93+
id: deployment
94+
uses: actions/deploy-pages@v4
95+
with:
96+
artifact_name: github-pages_ubuntu-24.04_python3.12

AUTHORS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Ahmed Ratnani
22
Mohamed Jalal Maaouni
33
Paul Rigor
4-
4+
Yaman Güçlü

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Welcome to IGA-Python
22

3-
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.
3+
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.
44

55
## Editing and building IGA-Python locally
66

@@ -70,3 +70,15 @@ nb-clean remove-filter
7070
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).
7171
4. `git commit` your changes.
7272
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).
73+
74+
## Contributing
75+
76+
There are several ways to contribute to this project.
77+
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).
78+
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).
79+
80+
All PRs are reviewed by the project maintainers.
81+
During the PR review, GitHub workflows are triggered on various platforms.
82+
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).
83+
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.
84+
To download the zip file, select the workflow run of interest from the `Actions` tab, click on `Summary`, and look under `Artifacts`.

0 commit comments

Comments
 (0)