-
Notifications
You must be signed in to change notification settings - Fork 9
43 lines (36 loc) · 1.26 KB
/
deploy-api-docs.yml
File metadata and controls
43 lines (36 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Deploy to GitHub Pages
on:
push:
branches:
- master # Trigger the workflow on a push to the 'master' branch
paths:
- 'airconsole-*.js'
jobs:
generate-and-deploy:
name: Generate and deploy GH Page
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
# Install npm dependencies (global or local)
- name: Install npm dependencies
run: |
npm install -g jsdoc@3.6.11
# Install Python dependencies if required
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
# Run the Python script to generate HTML content
- name: Run Python script
run: |
mkdir api-1-10-0
python .github/generate-docs.py ./airconsole-1.10.0.js # Assumes your Python script generates the HTML content
yes | cp -rf api-1-10-0/AirConsole.html api-1-10-0/index.html
mv api-1-10-0 docs # We rename this to ensure it is always the same folder for the last step
# Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs # The directory containing the generated HTML files