-
Notifications
You must be signed in to change notification settings - Fork 68
53 lines (45 loc) · 1.91 KB
/
Copy pathupdate-apidocs.yml
File metadata and controls
53 lines (45 loc) · 1.91 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
44
45
46
47
48
49
50
51
52
53
# .github/workflows/update-apidocs.yml
name: Generate and Deploy API Docs
# Controls when the action will run.
# This workflow runs on every push to the 'main' branch.
on:
push:
branches:
- master # Change this to your default branch (e.g., master)
permissions:
contents: write
pages: write
id-token: write
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-and-deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Free disk space
run: curl -fsSL https://raw.githubusercontent.com/kou/arrow/e49d8ae15583ceff03237571569099a6ad62be32/ci/scripts/util_free_space.sh | bash
# 1. Checks out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v5
# 2. Sets up Node.js in the runner
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # Specify the Node.js version you use
# 3. Installs the apidoc CLI tool globally
- name: Install apidoc
run: npm install -g apidoc
# 4. Runs the apidoc command to generate documentation
# -i: input directory (where your documented source code is)
# -o: output directory (where the docs will be generated)
- name: Generate API Docs
run: mkdir ./apidoc && apidoc -i server/ -o ./apidoc/
# 5. Deploys the generated documentation to the gh-pages branch
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
# This token is provided by Actions, you do not need to create your own secret
github_token: ${{ secrets.GITHUB_TOKEN }}
# The directory where your generated documentation is located
publish_dir: ./apidoc