Skip to content

Commit abca2f6

Browse files
authored
Publish wkcuber docs to S3 (#392)
* adds doc publish to s3 * ci * ci * ci * ci * readme + changelog * readme
1 parent f52b5a9 commit abca2f6

File tree

3 files changed

+64
-28
lines changed

3 files changed

+64
-28
lines changed

.github/workflows/main.yml

Lines changed: 59 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ jobs:
1818
python-version: ${{ matrix.python-version }}
1919
architecture: 'x64'
2020

21-
- name: Build docker image
22-
run: docker build -t scalableminds/webknossos-cuber:$GITHUB_SHA .
23-
2421
- name: Install dependencies
2522
run: |
2623
pip install poetry
@@ -42,18 +39,6 @@ jobs:
4239
- name: Python tests
4340
run: poetry run pytest tests
4441

45-
- name: Smoke test docker
46-
run: |
47-
docker run --rm \
48-
-v$(pwd)/testdata:/app/testdata \
49-
scalableminds/webknossos-cuber:$GITHUB_SHA \
50-
wkcuber.cubing \
51-
--jobs 2 \
52-
--batch_size 8 \
53-
--layer_name color \
54-
--wkw_file_len 32 \
55-
testdata/tiff testoutput/tiff
56-
5742
- name: Test tiff cubing
5843
run: tests/scripts/tiff_cubing.sh
5944

@@ -95,6 +80,65 @@ jobs:
9580
- name: Remove reference magnification data
9681
run: rm -r testdata/tiff_mag_2_reference/
9782

83+
- name: Generate Docs
84+
if: matrix.python-version == '3.8'
85+
run: |
86+
docs/api.sh --persist
87+
88+
- name: Push docs (for branch)
89+
if: startsWith(github.event.ref, 'refs/heads') && matrix.python-version == '3.8'
90+
env:
91+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
92+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
93+
AWS_DEFAULT_REGION: "eu-west-1"
94+
run: |
95+
CI_BRANCH=${GITHUB_REF##*/}
96+
NORMALIZED_CI_BRANCH=${CI_BRANCH//[\/-]/_}
97+
aws s3 sync --acl public-read docs/api s3://static.webknossos.org/lib-docs/${NORMALIZED_CI_BRANCH}
98+
99+
- name: Push docs (for tag)
100+
if: startsWith(github.event.ref, 'refs/tags') && matrix.python-version == '3.8'
101+
env:
102+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
103+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
104+
AWS_DEFAULT_REGION: "eu-west-1"
105+
run: |
106+
CI_TAG=$(git describe --tags)
107+
aws s3 sync --acl public-read docs/api s3://static.webknossos.org/lib-docs/${CI_TAG}
108+
109+
- name: Check if git is dirty
110+
run: |
111+
git diff --no-ext-diff --quiet --exit-code
112+
[[ -z $(git status -s) ]]
113+
114+
- name: Publish python package
115+
if: startsWith(github.event.ref, 'refs/tags') && matrix.python-version == '3.7'
116+
env:
117+
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
118+
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
119+
run: ./publish.sh
120+
121+
docker:
122+
needs: build
123+
runs-on: ubuntu-latest
124+
125+
steps:
126+
- uses: actions/checkout@v1
127+
- name: Build docker image
128+
run: docker build -t scalableminds/webknossos-cuber:$GITHUB_SHA .
129+
130+
- name: Smoke test docker
131+
run: |
132+
docker run --rm \
133+
-v$(pwd)/testdata:/app/testdata \
134+
scalableminds/webknossos-cuber:$GITHUB_SHA \
135+
wkcuber.cubing \
136+
--jobs 2 \
137+
--batch_size 8 \
138+
--layer_name color \
139+
--wkw_file_len 32 \
140+
testdata/tiff testoutput/tiff
141+
98142
- name: Login to docker
99143
env:
100144
DOCKER_USER: ${{ secrets.DOCKER_USER }}
@@ -130,15 +174,3 @@ jobs:
130174
scalableminds/webknossos-cuber:latest
131175
docker push scalableminds/webknossos-cuber:latest
132176
fi
133-
134-
- name: Check if git is dirty
135-
run: |
136-
git diff --no-ext-diff --quiet --exit-code
137-
[[ -z $(git status -s) ]]
138-
139-
- name: Publish python package
140-
if: startsWith(github.event.ref, 'refs/tags') && matrix.python-version == '3.7'
141-
env:
142-
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
143-
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
144-
run: ./publish.sh

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ For upgrade instructions, please check the respective *Breaking Changes* section
1212
### Breaking Changes in Config & CLI
1313

1414
### Added
15+
- The API documentation is now hosted on a publicwebpage. [#392](https://github.com/scalableminds/webknossos-cuber/pull/392)
1516

1617
### Changed
1718

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ tests/scripts/all_tests.sh
128128

129129
PyPi releases are automatically pushed when creating a new Git tag/Github release.
130130

131-
## Generate the API documentation
131+
## API documentation
132+
Check out the [latest version of the API documentation](https://static.webknossos.org/lib-docs/master/wkcuber/api.html).
133+
134+
### Generate the API documentation
132135
Run `docs/api.sh` to open a server displaying the API docs. `docs/api.sh --persist` persists the html to `docs/api`.
133136

134137
## Test Data Credits

0 commit comments

Comments
 (0)