-
Notifications
You must be signed in to change notification settings - Fork 11
91 lines (87 loc) · 3.16 KB
/
Copy pathdocs.yml
File metadata and controls
91 lines (87 loc) · 3.16 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: docs
permissions:
contents: write
on: push
jobs:
generate-docs-site:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up Node 23
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 23
- name: Build documentation
run: |
yarn install
yarn run docs:build
- name: Compress generated documentation assets
run: tar -C ./docs/.vitepress/dist -c -z -f docs.tar.gz .
- name: Upload compressed documentation assets
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: docs
path: docs.tar.gz
generate-api-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Protobuf Compiler
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- name: Set up Rust Nightly
uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1.16
with:
toolchain: nightly
cache: false
rustflags: ""
- name: Generate API documentation
run: |
ls -l .
ls -l .cargo/config.toml
make generate-api-docs
- name: Compress generated API documentation assets
run: tar -C ./target/doc -c -z -f api-docs.tar.gz .
- name: Upload compressed API documentation assets
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: api-docs
path: api-docs.tar.gz
publish:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs:
- generate-docs-site
- generate-api-docs
permissions:
id-token: write
steps:
- name: Get access token from dd-octo-sts
uses: DataDog/dd-octo-sts-action@96a25462dbcb10ebf0bfd6e2ccc917d2ab235b9a # v1.0.4
id: octo-sts
with:
scope: DataDog/saluki
policy: self.docs
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: docs
path: .
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: api-docs
path: .
- name: Create extract directory
run: mkdir -p /tmp/docs/api-docs
- name: Uncompress generated documentation assets
run: tar -C /tmp/docs -x -z -f ./docs.tar.gz && rm ./docs.tar.gz
- name: Uncompress generated API documentation assets
run: tar -C /tmp/docs/api-docs -x -z -f ./api-docs.tar.gz && rm ./api-docs.tar.gz
- name: Publish to Github Pages
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0
with:
github_token: "${{ steps.octo-sts.outputs.token }}"
publish_dir: /tmp/docs
commit_message: ${{ github.event.head_commit.message }}
enable_jekyll: false
allow_empty_commit: false