Skip to content

Commit ca16044

Browse files
committed
update deploy action for PyTorchLightning only
1 parent 848d963 commit ca16044

File tree

202 files changed

+36
-53187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+36
-53187
lines changed

.github/workflows/deploy-gh-pages.yml

Lines changed: 33 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -9,80 +9,54 @@ defaults:
99
run:
1010
shell: bash
1111

12-
env:
13-
FREEZE_REQUIREMENTS: "1"
14-
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
15-
PYPI_CACHE_DIR: "_pip-wheels"
16-
1712
jobs:
1813
make-html:
1914
runs-on: ubuntu-latest
20-
container:
21-
image: pytorchlightning/pytorch_lightning:docs
22-
strategy:
23-
fail-fast: false
24-
matrix:
25-
pkg-name: ["app", "fabric", "pytorch"]
15+
permissions:
16+
contents: write
2617
steps:
27-
- uses: actions/checkout@v3
18+
- name: Checkout
19+
uses: actions/checkout@v3
2820
with:
2921
submodules: true
3022

31-
- name: pip wheels cache
32-
uses: actions/cache/restore@v3
23+
- name: Setup Python
24+
uses: actions/setup-python@v4
3325
with:
34-
path: ${{ env.PYPI_CACHE_DIR }}
35-
key: pypi_wheels
26+
python-version: '3.10'
27+
cache: 'pip'
3628

37-
- name: Install package & dependencies
29+
- name: Upgrade pip
3830
run: |
39-
mkdir -p $PYPI_CACHE_DIR # in case cache was not hit
40-
ls -lh $PYPI_CACHE_DIR
41-
mkdir -p pypi_pkgs # in case template is not pulled
42-
pip --version
43-
pip install -U -r requirements.txt \
44-
-f pypi_pkgs/ -f $PYPI_CACHE_DIR -f ${TORCH_URL}
45-
pip install -U -r requirements/${{ matrix.pkg-name }}/docs.txt \
46-
-f pypi_pkgs/ -f $PYPI_CACHE_DIR -f ${TORCH_URL}
47-
pip list
48-
shell: bash
49-
50-
- name: Make Documentation
51-
working-directory: ./docs/source-${{ matrix.pkg-name }}
52-
run: make html --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going"
31+
# install pip=>20.1 to use "pip cache dir"
32+
python3 -m pip install --upgrade pip
5333
54-
- name: Keep artifact
55-
id: keep-artifact
56-
run: python -c "print('DAYS=' + str(7 if '${{ github.event_name }}'.startswith('pull_request') else 0))" >> $GITHUB_OUTPUT
34+
- name: Get pip cache dir
35+
id: pip-cache
36+
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
5737

58-
- name: Upload built docs
59-
uses: actions/upload-artifact@v3
38+
- name: Cache dependencies
39+
uses: actions/cache@v3
6040
with:
61-
name: docs-${{ matrix.pkg-name }}-${{ github.sha }}
62-
path: docs/build/html/
63-
retention-days: ${{ steps.keep-artifact.outputs.DAYS }}
41+
path: ${{ steps.pip-cache.outputs.dir }}
42+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
43+
restore-keys: |
44+
${{ runner.os }}-pip-
6445
65-
- name: Dump handy wheels
66-
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
46+
- name: Make Sphinx documentation for PyTorchLightning
47+
run: |
48+
# git config --global --add safe.directory '*' # to allow sphinx to write to any directory
49+
ls -alF docs/
50+
make docs
6751
continue-on-error: true
68-
uses: ./.github/actions/pip-wheels
69-
with:
70-
wheel-dir: ${{ env.PYPI_CACHE_DIR }}
71-
torch-url: ${{ env.TORCH_URL }}
72-
cache-key: "pypi_wheels"
7352

74-
deploy-docs:
75-
needs: [make-html]
76-
runs-on: ubuntu-latest
77-
strategy:
78-
fail-fast: false
79-
matrix:
80-
pkg-name: ["app", "fabric", "pytorch"]
81-
steps:
82-
- uses: actions/download-artifact@v3
83-
with:
84-
name: docs-${{ matrix.pkg-name }}-${{ github.sha }}
85-
path: docs/build/html/
53+
- name: Debug message
54+
run: |
55+
ls -alF /tmp
56+
cat /tmp/*.log
57+
ls -alF docs/build/html
58+
pip freeze
59+
8660
- name: Deploy to gh-pages branch
8761
uses: peaceiris/actions-gh-pages@v3
8862
with:
@@ -94,3 +68,4 @@ jobs:
9468
user_name: "GitHub Action"
9569
user_email: "reserve.dev@gmail.com"
9670
commit_message: "Rebuild w/ ${{ github.event.head_commit.message }}"
71+
allow_empty_commit: true

.gitmodules

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

Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ clean:
2929

3030
docs:
3131
git submodule update --init --recursive # get Notebook submodule
32-
pip install -qq lightning # install (stable) Lightning from PyPI instead of src
33-
pip install -qq -r requirements/app/base.txt
34-
pip install -qq -r requirements/pytorch/docs.txt
32+
pip install -r requirements.txt
3533
cd docs/source-pytorch && $(MAKE) html --jobs $(nproc) && cd ../../
3634

3735
update:

_notebooks/.actions/README.md

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

0 commit comments

Comments
 (0)