Remove numbering from the title of the cited standard #472
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Auto-generated by Cimas: Do not edit it manually! | |
# See https://github.com/metanorma/cimas | |
# NOTE: I edited it manually — sorry | |
name: docker | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
packages: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: metanorma/metanorma:latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Print Metanorma version | |
run: metanorma --version | |
# In case of cache miss, the generate MN XML step will run | |
# and the cache will be filled after job finishes. | |
# Next time it’ll be a cache hit, unless sources changed. | |
# See also “Upload cached Metanorma XML” step, which is important. | |
- name: Restore cached Metanorma XML, if any | |
id: cache-mn-xml | |
uses: actions/cache@v4 | |
env: | |
cache-name: _site | |
with: | |
path: _site | |
# NOTE: cache key does not include current MN version, | |
# which means if sources did not change but it’s desirable | |
# to rebuild XML using a newer MN version it may be impossible to do | |
# without making a dummy/meaningless change in the content | |
# to change the hash. | |
# | |
# The proper way to address this could be pinning MN version | |
# somewhere and including it as part of the hash here; | |
# alternatively, if we really want to always use whatever MN version | |
# is latest, we could detect that version and include it | |
# as part of this key. | |
key: ${{ runner.os }}-mn-${{ env.cache-name }}-${{ hashFiles('sources/00*-v5/**', 'sources/xmi/**', 'sources/liquid_templates/**', 'sources/guidance/**') }} | |
# We can fuzzy-match latest available cache, | |
# instead of precise hash. | |
# This can speed up build in some scenarios, | |
# but can in theory also cause issues where XML is not updated | |
# after source changes. | |
# restore-keys: | | |
# ${{ runner.os }}-mn-${{ env.cache-name }}- | |
# ${{ runner.os }}-mn- | |
# ${{ runner.os }}- | |
- name: Generate Metanorma XML | |
uses: actions-mn/build-and-publish@v2 | |
if: steps.cache-mn-xml.outputs.cache-hit != 'true' | |
with: | |
agree-to-terms: true | |
destination: artifact | |
artifact-name: mn | |
# In case of cache hit, we must explicitly upload the _site dir as artifact | |
- name: Upload cached Metanorma XML | |
uses: actions/upload-artifact@v4 | |
if: steps.cache-mn-xml.outputs.cache-hit == 'true' | |
with: | |
name: mn | |
path: _site | |
if-no-files-found: error | |
fl-build: | |
runs-on: ubuntu-latest | |
needs: build | |
strategy: | |
matrix: | |
document_dir: ["001", "002"] | |
name: Firelight build - Document ${{ matrix.document_dir }} | |
steps: | |
- name: Download Metanorma artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: mn | |
- name: "Firelight: create temporary Git repo" | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Metanorma CI" | |
git config --global init.defaultBranch main | |
git init . | |
- name: "Firelight: commit document ${{ matrix.document_dir }}" | |
run: | | |
git add documents/${{ matrix.document_dir }}-v5/document.presentation.xml | |
git commit -m "Commit presentation XML" | |
- name: "Firelight: prepare config for document ${{ matrix.document_dir }}" | |
run: | | |
cat <<'EOF' >> anafero-config.json | |
{ | |
"version": "0.1", | |
"entryPoint": "file:documents/${{ matrix.document_dir }}-v5/document.presentation.xml", | |
"storeAdapters": [ | |
"git+https://github.com/metanorma/firelight#main/packages/metanorma-xml-store" | |
], | |
"contentAdapters": [ | |
"git+https://github.com/metanorma/firelight#0.0.6.1/packages/metanorma-site-content" | |
], | |
"resourceLayouts": [ | |
"git+https://github.com/metanorma/firelight#main/packages/plateau-layout" | |
] | |
} | |
EOF | |
git add anafero-config.json | |
git commit -m "Add build config for ${{ matrix.document_dir }}" | |
- name: "Firelight: generate HTML for doc ${{ matrix.document_dir }}" | |
run: | | |
npx --node-options='--experimental-vm-modules' \ | |
-y @riboseinc/[email protected] \ | |
--target-dir dist/${{ matrix.document_dir }} \ | |
--path-prefix /mn-samples-plateau/${{ matrix.document_dir }} \ | |
--current-rev main | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: fl-${{ matrix.document_dir }} | |
path: dist | |
if-no-files-found: error | |
deploy-pages: | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
needs: fl-build | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Make dist dir | |
run: mkdir dist | |
- name: Download HTML artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: fl-* | |
path: dist | |
merge-multiple: true | |
- name: List files in dist | |
run: ls -l dist | |
- name: Upload pages artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: dist | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
# build-collection: | |
# runs-on: ubuntu-latest | |
# container: | |
# image: metanorma/metanorma:latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# with: | |
# submodules: true | |
# - name: Print Metanorma version | |
# run: metanorma --version | |
# - name: Generate Metanorma collection | |
# run: metanorma collection collection.yml --agree-to-terms | |
# - name: Upload collection artifacts | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: collection | |
# path: | | |
# index.html | |
# *_index.html | |
# document*.html | |
# collection.presentation.xml |