File tree Expand file tree Collapse file tree
{{ cookiecutter.name | lower }}/.github/workflows Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
44## [ Unreleased]
55
66## Added
7+ - Add ` DocC ` deployment template
8+ - Added in Pull Request[ #13 ] ( https://github.com/space-code/package-template/pull/13 ) .
79- Add additional badges to ` README.md `
810 - Added in Pull Request [ #12 ] ( https://github.com/space-code/package-template/pull/12 ) .
911- Add files to comply with community standards
Original file line number Diff line number Diff line change 2323 "additional_badges" : [
2424 " Yes" ,
2525 " No"
26+ ],
27+ "deploy_docc" : [
28+ " Yes" ,
29+ " No"
2630 ]
2731}
Original file line number Diff line number Diff line change 1+ import os
2+ import shutil
3+
4+ print (os .getcwd ())
5+
6+ def remove (filepath ):
7+ if os .path .isfile (filepath ):
8+ os .remove (filepath )
9+ elif os .path .isdir (filepath ):
10+ shutil .rmtree (filepath )
11+
12+ create_docc = '{{ cookiecutter.deploy_docc }}' == 'yes'
13+
14+ if not create_docc :
15+ remove (os .path .join (os .getcwd (), '.github/workflows' , 'deploy_docc.yml' ))
Original file line number Diff line number Diff line change 1+ name : Deploy DocC
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ permissions :
9+ contents : read
10+ pages : write
11+ id-token : write
12+
13+ concurrency :
14+ group : " pages"
15+ cancel-in-progress : true
16+
17+ jobs :
18+ deploy :
19+ environment :
20+ name : github-pages
21+ {% raw %}
22+ url : ${{ steps.deployment.outputs.page_url }}
23+ {% endraw %}
24+ runs-on : macos-12
25+ steps :
26+ - name : Checkout 🛎️
27+ uses : actions/checkout@v3
28+ - name : Build DocC
29+ run : |
30+ swift build;
31+ swift package \
32+ --allow-writing-to-directory ./docs \
33+ generate-documentation \
34+ --target {{ cookiecutter.name }} \
35+ --output-path ./docs \
36+ --transform-for-static-hosting \
37+ --hosting-base-path {{ cookiecutter.name | lower }};
38+ - name : Upload artifact
39+ uses : actions/upload-pages-artifact@v1
40+ with :
41+ path : ' docs'
42+ - name : Deploy to GitHub Pages
43+ id : deployment
44+ uses : actions/deploy-pages@v1
You can’t perform that action at this time.
0 commit comments