Skip to content

Commit 754daeb

Browse files
committed
ci(build): automated builds and deployment to pages
Use a matrix to parallelize building the docs for listed DEVFAMILY and OS combinations. Aggregate the results to build an expected pages artifact. Deploy the monolithic artifact to GitHub pages. If any platform fails for any reason, the arguments and logs for that build will be logged under a separate section of this workflow, and the results should not be deployed. This also builds a rudimentary landing page linking to all builds since GitHub pages will not allow you to browse deployed files directly. Signed-off-by: Randolph Sapp <[email protected]>
1 parent 71bdf5e commit 754daeb

File tree

2 files changed

+142
-0
lines changed

2 files changed

+142
-0
lines changed

.github/workflows/build.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
name: "build"
3+
4+
on:
5+
push:
6+
branches: [master]
7+
8+
concurrency:
9+
group: ${{ github.ref_name }}
10+
cancel-in-progress: true
11+
12+
defaults:
13+
run:
14+
shell: bash
15+
16+
jobs:
17+
build:
18+
name: Build Linux Documents
19+
runs-on: ubuntu-latest
20+
container:
21+
image: ghcr.io/texasinstruments/processor-sdk-doc:latest
22+
options: --entrypoint /bin/bash
23+
strategy:
24+
matrix:
25+
os: [linux]
26+
device:
27+
- AM335X
28+
- AM437X
29+
- AM57X
30+
- AM62AX
31+
- AM62PX
32+
- AM62X
33+
- AM64X
34+
- AM65X
35+
- AM67
36+
- AM68
37+
- AM69
38+
- CORESDK
39+
- DRA821A
40+
- GEN
41+
- J7200
42+
- J721E
43+
- J721S2
44+
- J722S
45+
- J742S2
46+
- J784S4
47+
include:
48+
- os: android
49+
device: AM62PX
50+
- os: android
51+
device: AM62X
52+
- os: android
53+
device: GEN
54+
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@v4
58+
59+
- name: Build ${{ matrix.device }}
60+
run: |
61+
make DEVFAMILY=${{ matrix.device }} OS=${{ matrix.os }} \
62+
VERSION=${{ github.ref_name }}
63+
64+
- name: Upload artifact
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: ${{ matrix.device }}-${{ matrix.os }}
68+
path: build/
69+
retention-days: 1
70+

.github/workflows/deploy.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
name: "deploy"
3+
4+
on:
5+
workflow_run:
6+
workflows:
7+
- build
8+
types:
9+
- completed
10+
11+
jobs:
12+
agregate:
13+
name: Agregate build artifacts
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Download all artifacts
18+
uses: actions/download-artifact@v4
19+
with:
20+
github-token: ${{ secrets.GITHUB_TOKEN }}
21+
path: build
22+
merge-multiple: true
23+
run-id: ${{ github.event.workflow_run.id }}
24+
25+
- name: Generate root index
26+
run: |
27+
cat << EOF > build/index.html
28+
<!DOCTYPE html>
29+
<html lang="en">
30+
<head>
31+
<meta charset="utf-8">
32+
<title>PSDK Documentation Landing Page</title>
33+
</head>
34+
<body>
35+
<main>
36+
<h1>PSDK Documentation Landing Page</h1>
37+
<ul>
38+
EOF
39+
40+
for path in build/*/; do
41+
root_index=$(find "$path" -name index.html | sort -u | tail -1)
42+
if [ -n "$root_index" ]; then
43+
text=$(basename "$path")
44+
relative_path=$(realpath "$root_index" --relative-to=build)
45+
printf ' <li><a href="%s">%s</a></li>\n' \
46+
"$relative_path" "$text" >> build/index.html
47+
fi
48+
done
49+
50+
cat << EOF >> build/index.html
51+
</ul>
52+
</main>
53+
</body>
54+
</html>
55+
EOF
56+
57+
- name: Upload static files as single artifact
58+
uses: actions/upload-pages-artifact@v3
59+
with:
60+
path: build
61+
62+
deploy:
63+
name: Deploy
64+
runs-on: ubuntu-latest
65+
needs: agregate
66+
permissions:
67+
pages: write
68+
id-token: write
69+
70+
steps:
71+
- name: Update github page deployment
72+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)