File tree 2 files changed +24
-4
lines changed
2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 7
7
push :
8
8
branches :
9
9
- master
10
+ - develop
10
11
11
12
jobs :
12
13
docs :
@@ -17,10 +18,28 @@ jobs:
17
18
uses : actions/setup-python@v1
18
19
with :
19
20
python-version : " 3.8"
21
+ - name : Capture branch and tag
22
+ id : branch_name
23
+ run : |
24
+ echo ::set-env name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
25
+ echo ::set-env name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
20
26
- name : Build docs website
21
- run : make build-docs
22
- - name : Deploy docs
27
+ run : make build-docs-website
28
+ - name : Build docs API reference
29
+ if : env.SOURCE_BRANCH == 'master'
30
+ run : make build-docs-api
31
+ - name : Deploy docs website
23
32
uses : peaceiris/actions-gh-pages@v3
24
33
with :
25
34
github_token : ${{ secrets.GITHUB_TOKEN }}
26
35
publish_dir : ./dist
36
+ # when deploying docs website only
37
+ # we need to keep existing API docs checked in
38
+ # but only for dev branch
39
+ keep_files : true
40
+ - name : Deploy all docs
41
+ uses : peaceiris/actions-gh-pages@v3
42
+ if : env.SOURCE_BRANCH == 'master'
43
+ with :
44
+ github_token : ${{ secrets.GITHUB_TOKEN }}
45
+ publish_dir : ./dist
Original file line number Diff line number Diff line change @@ -29,16 +29,17 @@ build: pr
29
29
poetry run build
30
30
31
31
build-docs :
32
- mkdir -p dist/api
33
32
@$(MAKE ) build-docs-website
34
33
@$(MAKE ) build-docs-api
35
34
36
35
build-docs-api : dev
36
+ mkdir -p dist/api
37
37
poetry run pdoc --html --output-dir dist/api/ ./aws_lambda_powertools --force
38
- mv dist/api/aws_lambda_powertools/* dist/api/
38
+ mv -f dist/api/aws_lambda_powertools/* dist/api/
39
39
rm -rf dist/api/aws_lambda_powertools
40
40
41
41
build-docs-website : dev-docs
42
+ mkdir -p dist
42
43
cd docs && npm run build
43
44
cp -R docs/public/* dist/
44
45
You can’t perform that action at this time.
0 commit comments