Skip to content

Commit 98c5df0

Browse files
authored
remove circle ci + add pr docs predisplay (deepinv#607)
* remove circle ci + modify docs push * hai comments + contributing guidelines * fix yaml * edit if message exists * yaml refix * prpreview cleanup * try sth * fix * fix again * fix * try sth 2 * fix again * try * and now * ahhh * add permission * fix link * fix link * move to end * add tip
1 parent f304b6a commit 98c5df0

File tree

7 files changed

+58
-105
lines changed

7 files changed

+58
-105
lines changed

.circleci/config.yml

Lines changed: 0 additions & 72 deletions
This file was deleted.

.github/pull_request_template.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ Thank you for contributing to DeepInverse!
33

44
Please refer to our [contributing guidelines](https://deepinv.github.io/deepinv/contributing.html) for full instructions on how to contribute, including writing tests, documentation and code style.
55

6+
Once the GitHub tests have been approved by a maintainer (only required for first-time contributors), and the `Build Docs` GitHub action
7+
has run successfully, you can check the generated docs online at https://deepinv.github.io/deepinv/pr-preview/pr-N/ where `N` is the PR number.
8+
69
### Checks to be done before submitting your PR
710

811
- [ ] `python3 -m pytest deepinv/tests` runs successfully.

.github/workflows/cleanup_docs.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Cleanup PR Docs on Close
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
cleanup:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout gh-pages branch
13+
uses: actions/checkout@v3
14+
with:
15+
ref: gh-pages
16+
persist-credentials: true
17+
18+
- name: Remove PR folder
19+
run: |
20+
PR_DIR="pr-preview/pr-${{ github.event.pull_request.number }}"
21+
if [ -d "$PR_DIR" ]; then
22+
rm -rf "$PR_DIR"
23+
echo "Removed $PR_DIR"
24+
else
25+
echo "No preview folder to remove."
26+
fi
27+
28+
- name: Commit and push
29+
run: |
30+
git config user.name "github-actions"
31+
git config user.email "[email protected]"
32+
git add -A
33+
git commit -m "Clean up docs for PR #${{ github.event.pull_request.number }}" || echo "Nothing to commit"
34+
git push

.github/workflows/documentation.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ concurrency:
1616

1717
permissions:
1818
contents: write
19+
pull-requests: write
1920

2021
jobs:
2122
docs:
@@ -41,12 +42,20 @@ jobs:
4142
# Run doctest with sphinx, to get the extra IGNORE_OUTPUT primitive
4243
# using plot_gallery=0 to avoid building examples
4344
sphinx-build -M doctest docs/source/ docs/build/ -D plot_gallery=0 -v $_doctest_files
44-
- name: Deploy
45+
- name: Deploy PR Docs to gh-pages
4546
uses: peaceiris/actions-gh-pages@v3
46-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
47+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'pull_request' }}
4748
with:
48-
publish_branch: gh-pages
4949
github_token: ${{ secrets.GITHUB_TOKEN }}
50+
publish_branch: gh-pages
5051
publish_dir: _build/
51-
force_orphan: true
52+
destination_dir: ${{ github.event_name == 'pull_request' && format('pr-preview/pr-{0}', github.event.pull_request.number) || '' }}
53+
keep_files: true
5254
enable_jekyll: false
55+
force_orphan: false
56+
- name: Comment on PR with preview url
57+
uses: mshick/add-pr-comment@v2
58+
if: ${{ github.event_name == 'pull_request' && github.event.action != 'closed' }}
59+
with:
60+
message: |
61+
Documentation preview for this PR at ${{ format('https://deepinv.github.io/deepinv/pr-preview/pr-{0}', github.event.pull_request.number) }}

.github/workflows/expose_doc.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ authors:
5656
given-names: "Romain"
5757
- family-names: "Weiss"
5858
given-names: "Pierre"
59-
version: "0.3.0"
59+
version: "0.3.2"
6060
doi: "https://doi.org/10.48550/arXiv.2505.20160"
6161
date-released: 2023-06-30
6262
repository-code: "https://github.com/deepinv/deepinv"

docs/source/contributing.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ check the following points:
4444
After making the desired changes, check the documentation by installing
4545
``sphinx`` and building the docs by running one of the commands in the table below in the ``docs`` directory.
4646
Note that if the build process fails, supplementary additional libraries may need to be manually installed
47-
(e.g. ``sphinx-gallery``): please follow instructions in the log.
47+
(e.g. ``sphinx-gallery``): please follow instructions in the log.
48+
49+
.. tip::
50+
51+
Once the GitHub tests have been approved by a maintainer (only required for first-time contributors), and the `Build Docs` GitHub action
52+
has run successfully, you can check the generated docs online at https://deepinv.github.io/deepinv/pr-preview/pr-N/ where `N` is the PR number.
53+
4854

4955
.. list-table::
5056
:widths: 40 50

0 commit comments

Comments
 (0)