chore(ops): add FL build (WIP) #423
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 | |
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 | |
build-firelight: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download Metanorma artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: github-pages | |
- name: Display structure of downloaded files | |
run: ls -R | |
- 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/**/*.presentation.xml | |
git commit -m "Commit presentation XML" | |
- name: "Firelight: prepare config for 001" | |
run: | | |
cat <<'EOF' >> anafero-config.json | |
{ | |
"version": "0.1", | |
"entryPoint": "file:documents/001-v4/document.presentation.xml", | |
"storeAdapters": [ | |
"git+https://github.com/metanorma/firelight#next/packages/metanorma-xml-store" | |
], | |
"contentAdapters": [ | |
"git+https://github.com/metanorma/firelight#next/packages/metanorma-site-content" | |
], | |
"resourceLayouts": [ | |
"git+https://github.com/metanorma/firelight#next/packages/plateau-layout" | |
] | |
} | |
EOF | |
git add anafero-config.json | |
git commit -m "Add build config" | |
- name: "Firelight: generate HTML" | |
run: | | |
npx --node-options='--experimental-vm-modules' -y @riboseinc/[email protected] --target-dir dist --path-prefix /mn-samples-plateau --current-rev main | |
deploy-firelight-html: | |
runs-on: ubuntu-latest | |
needs: build-firelight | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Upload 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 |