File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 pull_request :
88 branches : [ "main" ]
99
10+ workflow_dispatch :
11+ inputs :
12+ generate_documentation :
13+ description : Generate documentation
14+ required : false
15+ type : boolean
16+ default : false
17+
1018env :
1119 CARGO_TERM_COLOR : always
1220
21+ permissions :
22+ contents : read
23+ pages : write
24+ id-token : write
25+
1326jobs :
1427 build :
1528 runs-on : ubuntu-latest
4659
4760 - name : Run tests
4861 run : cargo test --verbose
62+
63+ - name : Generate documentation (on demand)
64+ if : github.event_name == 'workflow_dispatch' && inputs.generate_documentation
65+ run : cargo doc --workspace --no-deps --verbose
66+
67+ - name : Add documentation landing page
68+ if : github.event_name == 'workflow_dispatch' && inputs.generate_documentation
69+ run : |
70+ cat > target/doc/index.html <<'HTML'
71+ <!doctype html>
72+ <html lang="en">
73+ <head>
74+ <meta charset="utf-8">
75+ <meta http-equiv="refresh" content="0; url=oneapi_rs/">
76+ <title>oneapi-rs documentation</title>
77+ </head>
78+ <body>
79+ <p><a href="oneapi_rs/">oneapi-rs documentation</a></p>
80+ </body>
81+ </html>
82+ HTML
83+
84+ - name : Configure GitHub Pages
85+ if : github.event_name == 'workflow_dispatch' && inputs.generate_documentation
86+ uses : actions/configure-pages@v5
87+
88+ - name : Upload documentation to GitHub Pages
89+ if : github.event_name == 'workflow_dispatch' && inputs.generate_documentation
90+ uses : actions/upload-pages-artifact@v3
91+ with :
92+ path : target/doc
93+
94+ deploy-documentation :
95+ if : github.event_name == 'workflow_dispatch' && inputs.generate_documentation
96+ needs : build
97+ runs-on : ubuntu-latest
98+
99+ environment :
100+ name : github-pages
101+ url : ${{ steps.deployment.outputs.page_url }}
102+
103+ steps :
104+ - name : Deploy documentation to GitHub Pages
105+ id : deployment
106+ uses : actions/deploy-pages@v4
You can’t perform that action at this time.
0 commit comments