1- name : Deploy API Docs
1+ name : Deploy OpenAPI docs to GitHub Pages
2+
23on :
34 push :
4- branches : [main, add-genome-groups]
5- paths : ['APISpecification.yaml'] # Only run when spec changes
5+ branches :
6+ - main
7+ - add-genome-groups
8+ paths :
9+ - ' docs/**'
10+ - ' .github/workflows/deploy-docs.yml'
11+
12+ permissions :
13+ contents : read
14+ pages : write
15+ id-token : write
16+
17+ concurrency :
18+ group : ' pages'
19+ cancel-in-progress : true
620
721jobs :
822 deploy :
23+ environment :
24+ name : github-pages
25+ url : ${{ steps.deployment.outputs.page_url }}
926 runs-on : ubuntu-latest
27+
1028 steps :
11- - uses : actions/checkout@v4
12-
13- - name : Create documentation page
14- run : |
15- cat > index.html << 'EOF'
16- <!DOCTYPE html>
17- <html>
18- <head>
19- <title>API Documentation</title>
20- <meta charset="utf-8"/>
21- <meta name="viewport" content="width=device-width, initial-scale=1">
22- <link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
23- <style> body { margin: 0; padding: 0; } </style>
24- </head>
25- <body>
26- <redoc spec-url='APISpecification.yaml'></redoc>
27- <script src="https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"></script>
28- </body>
29- </html>
30- EOF
29+ - name : Checkout
30+ uses : actions/checkout@v4
3131
32- - name : Deploy to GitHub Pages
33- uses : peaceiris/actions-gh-pages@v3
32+ - name : Setup Pages
33+ uses : actions/configure-pages@v5
34+
35+ - name : Upload artifact
36+ uses : actions/upload-pages-artifact@v3
3437 with :
35- github_token : ${{ secrets.GITHUB_TOKEN }}
36- publish_dir : ./
37- publish_branch : gh-pages
38+ path : docs
39+
40+ - name : Deploy to GitHub Pages
41+ id : deployment
42+ uses : actions/deploy-pages@v4
0 commit comments