Skip to content

Commit ed72f6b

Browse files
committed
Also render the DPE iRoT profile.
1 parent 8e631d9 commit ed72f6b

File tree

3 files changed

+55
-11
lines changed

3 files changed

+55
-11
lines changed

.github/workflows/deploy_pages.yml

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ defaults:
1616
run:
1717
shell: bash
1818
jobs:
19-
# Upload Device Identity Provisioning spec
20-
device-identity-provisioning-spec:
19+
# Upload spec HTML
20+
spec-html:
2121
runs-on: ubuntu-latest
2222
container:
2323
image: ghcr.io/trustedcomputinggroup/pandoc:latest
24-
name: Render Device Identity Provisioning HTML
24+
name: Render Spec HTML
2525
steps:
2626
- name: Checkout
2727
uses: actions/checkout@v3
@@ -36,7 +36,7 @@ jobs:
3636
fetch-tags: true
3737
repository: "opencomputeproject/ocp-spec-tools"
3838
# The underlying tex and templates assume this exists under the "extra" folder.
39-
path: "specifications/device-identity-provisioning/extra"
39+
path: "ocp-spec-tools"
4040

4141
- name: Render Device Identity Provisioning HTML
4242
run: |
@@ -47,6 +47,8 @@ jobs:
4747
GIT_REFS=()
4848
GIT_REFS+=("main")
4949
50+
ln -s ocp-spec-tools specifications/device-identity-provisioning/extra
51+
5052
for ref in "${GIT_REFS[@]}"; do
5153
echo "Building git ref $ref"
5254
@@ -78,23 +80,65 @@ jobs:
7880
echo "Added webpage device-identity-provisioning/${trimmed_ref}/index.html"
7981
done
8082
81-
- name: Upload artifacts for device-identity-provisioning spec
83+
- name: Render DPE iRoT Profile HTML
84+
run: |
85+
# Need to trust directory in the docker container.
86+
chown -R $(id -u):$(id -g) $PWD
87+
88+
# Publish pages for `main`
89+
GIT_REFS=()
90+
GIT_REFS+=("main")
91+
92+
ln -s ocp-spec-tools specifications/dpe-irot-profile/extra
93+
94+
for ref in "${GIT_REFS[@]}"; do
95+
echo "Building git ref $ref"
96+
97+
git reset --hard $ref
98+
99+
pushd specifications/dpe-irot-profile
100+
101+
if [[ "${ref}" == "main" ]]; then
102+
# Label the current spec version.
103+
commit_hash=$(git rev-parse --short HEAD)
104+
sed -i -r "/^---$/,/^---$/s/(version: .*)/\1 (Git commit ${commit_hash})/g" spec.ocp
105+
fi
106+
107+
/usr/bin/build.sh \
108+
--crossref=tcg \
109+
--csl extra/ocp-pandoc-resources/ieee.csl \
110+
--nogitversion \
111+
--template_html extra/ocp-pandoc-resources/html/ocp.html.template \
112+
--html_stylesheet extra/ocp-pandoc-resources/html/style.css \
113+
--html_stylesheet extra/ocp-pandoc-resources/html/github-markdown.css \
114+
--html spec.html spec.ocp
115+
116+
popd
117+
118+
trimmed_ref="HEAD"
119+
120+
mkdir -p "gh-pages/dpe-irot-profile/${trimmed_ref}"
121+
cp specifications/dpe-irot-profile/spec.html "gh-pages/dpe-irot-profile/${trimmed_ref}/index.html"
122+
echo "Added webpage dpe-irot-profile/${trimmed_ref}/index.html"
123+
done
124+
125+
- name: Upload artifacts for rendered specs
82126
uses: actions/upload-artifact@v4
83127
with:
84-
name: device-identity-provisioning
128+
name: rendered-html
85129
path: gh-pages
86130

87131
deploy:
88132
environment:
89133
name: github-pages
90134
url: ${{ steps.deployment.outputs.page_url }}
91135
runs-on: ubuntu-latest
92-
needs: [device-identity-provisioning-spec]
136+
needs: [spec-html]
93137
steps:
94-
- name: Download device-identity-provisioning artifacts
138+
- name: Download artifacts
95139
uses: actions/download-artifact@v4
96140
with:
97-
name: device-identity-provisioning
141+
name: rendered-html
98142
path: gh-pages
99143
- name: Upload static files as artifact
100144
uses: actions/upload-pages-artifact@v3

specifications/dpe-irot-profile/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
## Specification source
44

5-
The specification source is available in [main.ocp](./main.ocp).
5+
The specification source is available in [spec.ocp](./spec.ocp).
66

77
## Building the specification
88

99
To view a rendered version of the specification, clone the [ocp-spec-tools](https://github.com/opencomputeproject/ocp-spec-tools) repository, and then run:
1010

1111
```sh
1212
$ path/to/ocp-spec-tools/docker-pull.sh
13-
$ path/to/ocp-spec-tools/docker-run.sh --pdf dpe-irot-profile.pdf main.ocp
13+
$ path/to/ocp-spec-tools/docker-run.sh --pdf dpe-irot-profile.pdf spec.ocp
1414
```

0 commit comments

Comments
 (0)