Skip to content

chore(ops): add FL build (WIP) #431

chore(ops): add FL build (WIP)

chore(ops): add FL build (WIP) #431

Workflow file for this run

# 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
- name: Metanorma generate site
uses: actions-mn/build-and-publish@v2
with:
agree-to-terms: true
destination: artifact
artifact-name: mn
fl-build-001:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download Metanorma artifacts
uses: actions/download-artifact@v4
with:
name: mn
- name: "Firelight: commit docs"
run: |
git config --global user.email "[email protected]"
git config --global user.name "Metanorma CI"
git config --global init.defaultBranch main
git init .
git add documents/001*/*.presentation.xml
git commit -m "Commit presentation XML"
- name: "Firelight: prepare config for doc 001"
run: |
cat <<'EOF' >> anafero-config.json
{
"version": "0.1",
"entryPoint": "file:documents/001-v5/document.presentation.xml",
"storeAdapters": [
"git+https://github.com/metanorma/firelight#main/packages/metanorma-xml-store"
],
"contentAdapters": [
"git+https://github.com/metanorma/firelight#main/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 001"
- name: "Firelight: generate HTML for doc 001"
run: |
npx --node-options='--experimental-vm-modules' -y @riboseinc/[email protected] --target-dir dist --path-prefix /mn-samples-plateau/001 --current-rev main
- uses: actions/upload-artifact@v4
with:
name: fl-001
path: dist
if-no-files-found: error
fl-build-002:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download Metanorma artifacts
uses: actions/download-artifact@v4
with:
name: mn
- name: "Firelight: commit docs"
run: |
git config --global user.email "[email protected]"
git config --global user.name "Metanorma CI"
git config --global init.defaultBranch main
git init .
git add documents/002*/*.presentation.xml
git commit -m "Commit presentation XML"
- name: "Firelight: prepare config for doc 002"
run: |
cat <<'EOF' >> anafero-config.json
{
"version": "0.1",
"entryPoint": "file:documents/002-v5/document.presentation.xml",
"storeAdapters": [
"git+https://github.com/metanorma/firelight#main/packages/metanorma-xml-store"
],
"contentAdapters": [
"git+https://github.com/metanorma/firelight#main/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 002"
- name: "Firelight: generate HTML for doc 002"
run: |
npx --node-options='--experimental-vm-modules' -y @riboseinc/[email protected] --target-dir dist --path-prefix /mn-samples-plateau/002 --current-rev main
- uses: actions/upload-artifact@v4
with:
name: fl-002
path: dist
if-no-files-found: error
deploy-pages:
runs-on: ubuntu-latest
needs: [fl-build-001, fl-build-002]
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 FL001 HTML artifact
uses: actions/download-artifact@v4
with:
name: fl-001
path: dist/001
- name: Download FL002 HTML artifact
uses: actions/download-artifact@v4
with:
name: fl-002
path: dist/002
- 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