@@ -29,21 +29,102 @@ jobs:
2929 - name : Bundler install
3030 uses : metanorma/ci/docker-gem-install@main
3131
32- - name : Metanorma generate site
32+ - name : Print Metanorma version
33+ run : metanorma --version
34+
35+ - name : Generate Metanorma XML
3336 uses : actions-mn/build-and-publish@v2
3437 with :
35- destination : gh-pages
38+ destination : artifact
39+ artifact-name : mn
3640 agree-to-terms : true
37- use-bundler : true
41+
42+ fl-build :
43+ runs-on : ubuntu-latest
44+ needs : build
45+ name : Build Firelight version
46+
47+ steps :
48+ - name : Download Metanorma artifacts
49+ uses : actions/download-artifact@v4
50+ with :
51+ name : mn
52+
53+ - name : " Firelight: create temporary Git repo"
54+ run : |
55+ git config --global user.email "57123902+metanorma-ci@users.noreply.github.com"
56+ git config --global user.name "Metanorma CI"
57+ git config --global init.defaultBranch main
58+ git init .
59+
60+ - name : " Firelight: commit"
61+ run : |
62+ git add documents/_site/documents.xml
63+ git commit -m "Commit MN XML"
64+
65+ - name : " Firelight: prepare config"
66+ run : |
67+ cat <<'EOF' >> anafero-config.json
68+ {
69+ "version": "0.1",
70+ "entryPoint": "file:_site/documents.xml",
71+ "storeAdapters": [
72+ "git+https://github.com/metanorma/firelight#collection-support/packages/relaton-collection-xml-store",
73+ "git+https://github.com/metanorma/firelight#collection-support/packages/metanorma-xml-store"
74+ ],
75+ "contentAdapters": [
76+ "git+https://github.com/metanorma/firelight#collection-support/packages/metanorma-site-content"
77+ ],
78+ "resourceLayouts": [
79+ "git+https://github.com/metanorma/firelight#collection-support/packages/plateau-layout"
80+ ]
81+ }
82+ EOF
83+ git add anafero-config.json
84+ git commit -m "Add build config"
85+
86+ - name : " Firelight: generate HTML"
87+ run : |
88+ npx --node-options='--experimental-vm-modules' \
89+ -y @riboseinc/anafero-cli@0.0.42 \
90+ --target-dir _site \
91+ --path-prefix /cc-admin-documents \
92+ --current-rev main
93+
94+ - uses : actions/upload-artifact@v4
95+ with :
96+ name : fl
97+ path : _site
98+ if-no-files-found : error
3899
39100 deploy :
40101 if : ${{ github.ref_name == github.event.repository.default_branch }}
41102 environment :
42103 name : github-pages
43104 url : ${{ steps.deployment.outputs.page_url }}
44105 runs-on : ubuntu-latest
45- needs : build
106+ needs : fl- build
46107 steps :
108+ - name : Setup Pages
109+ uses : actions/configure-pages@v5
110+
111+ - name : Make dist dir
112+ run : mkdir dist
113+
114+ - name : Download HTML artifacts
115+ uses : actions/download-artifact@v4
116+ with :
117+ pattern : fl
118+ path : dist
119+
120+ - name : List files in dist
121+ run : ls -l dist
122+
123+ - name : Upload pages artifact
124+ uses : actions/upload-pages-artifact@v3
125+ with :
126+ path : dist
127+
47128 - name : Deploy to GitHub Pages
48129 id : deployment
49130 uses : actions/deploy-pages@v4
0 commit comments