1+ name : pages.yml
2+ on :
3+ push :
4+ branches :
5+ - " main_protected"
6+
7+ workflow_dispatch :
8+
9+ permissions :
10+ contents : read
11+ pages : write
12+ id-token : write
13+
14+ concurrency :
15+ group : " pages"
16+ cancel-in-progress : false
17+
18+ jobs :
19+ build :
20+ name : " Generate pages"
21+ runs-on : " ubuntu-22.04"
22+
23+ environment :
24+ name : github-pages
25+ url : ${{ steps.deployment.outputs.page_url }}
26+
27+ steps :
28+ - uses : actions/checkout@v4
29+
30+ - name : Setup Pages
31+ uses : actions/configure-pages@v5
32+
33+ - name : Disable man-db auto-update
34+ run : sudo rm -f /var/lib/man-db/auto-update
35+
36+ - name : Generate skeleton
37+ run : |
38+ mkdir -p _site
39+ cat << EOF > _site/index.html
40+ <!DOCTYPE html>
41+ <meta charset=utf-8>
42+ <title>Redirecting...</title>
43+ <link rel=canonical href="./icd/">
44+ <meta http-equiv=refresh content="0; url=./icd/">
45+ EOF
46+
47+ mkdir -p _site/icd
48+
49+ - name : Download & install xidel
50+ working-directory : ${{ runner.temp }}
51+ run : |
52+ wget "https://sourceforge.net/projects/videlibri/files/Xidel/Xidel%20development/xidel_0.9.9-1_amd64.deb/download" -O xidel.deb
53+ sudo apt install ./xidel.deb
54+
55+ - name : Download & install asn1scc
56+ working-directory : ${{ runner.temp }}
57+ run : |
58+ wget "https://github.com/scsd-cdh/asn1scc/releases/latest/download/asn1scc.linux.x86_64.zip" -O asn1scc.zip
59+ unzip -d asn1scc asn1scc.zip
60+
61+ - name : Generate ICDs
62+ run : |
63+ echo << EOF >> _site/icd/index.html
64+ <html>
65+ <head>
66+ <title>CDH ICDs</title>
67+ </head>
68+ <body>
69+ <ul>
70+ EOF
71+
72+ for file in APP/_asn1/*.asn1; do
73+ echo "${file}"
74+ file_html="${file%.asn1}.html"
75+
76+ echo << EOF > _site/icd/index.html
77+ <li><a href="./${file_html}">${file}</a></li>
78+ EOF
79+
80+ ${{ runner.temp }}/asn1scc/asn1scc --icdacn "_site/icd/${file_html}" "${file}"
81+ done
82+
83+ echo << EOF > _site/icd/index.html
84+ </ul>
85+ </body>
86+ </html>
87+ EOF
88+
89+ - name : Upload artifact
90+ uses : actions/upload-pages-artifact@v3
91+ with :
92+ path : ' _site'
93+
94+ - name : Deploy to GitHub Pages
95+ id : deployment
96+ uses : actions/deploy-pages@v4
0 commit comments