Skip to content

Commit 068fa5f

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 068fa5f

File tree

2 files changed

+140
-0
lines changed

2 files changed

+140
-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: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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 class="inner cover" role="main">
36+
<h1>PSDK Documentation Landing Page</h1>
37+
EOF
38+
39+
for path in build/*/; do
40+
root_index=$(find "$path" -name index.html | sort -u | tail -1)
41+
if [ -n "$root_index" ]; then
42+
text=$(basename "$path")
43+
relative_path=$(realpath "$root_index" --relative-to=build)
44+
printf ' <a href="%s">%s</a>\n' \
45+
"$relative_path" "$text" >> build/index.html
46+
fi
47+
done
48+
49+
cat << EOF >> build/index.html
50+
</main>
51+
</body>
52+
</html>
53+
EOF
54+
55+
- name: Upload static files as single artifact
56+
uses: actions/upload-pages-artifact@v3
57+
with:
58+
path: build
59+
60+
deploy:
61+
name: Deploy
62+
runs-on: ubuntu-latest
63+
needs: agregate
64+
permissions:
65+
pages: write
66+
id-token: write
67+
68+
steps:
69+
- name: Update github page deployment
70+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)