diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 12c1b92f..7ed3de12 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,8 +1,10 @@ +# Auto-generated by Cimas: Do not edit it manually! +# See https://github.com/metanorma/cimas name: docker on: push: - branches: [ main, firelight-test-march-2025 ] + branches: [ main ] pull_request: workflow_dispatch: @@ -19,183 +21,23 @@ concurrency: jobs: build: runs-on: ubuntu-latest - # container: - # image: metanorma/metanorma:latest + container: + image: metanorma/metanorma:latest steps: - name: Checkout uses: actions/checkout@v6 - - - name: Setup Ruby - uses: ruby/setup-ruby@v1 with: - ruby-version: '3.4' - bundler-cache: true - - # # Uses https://github.com/metanorma/ci/blob/main/inkscape-setup-action/action.yml - # - name: Install Inkscape - # uses: metanorma/ci/inkscape-setup-action@main - - - name: Update Fontist - run: bundle exec fontist update - - - name: Re-install Fontist to global and install font using global fontist - run: | - gem install fontist - fontist --version - fontist update - fontist install "STIX Two Math" - - - name: Print Metanorma version - run: bundle exec metanorma --version + submodules: true - - name: Cache or generate Metanorma XML - uses: actions-mn/build-and-publish@v2 + - name: Setup Flavor + uses: actions-mn/setup-flavors@main with: - token: ${{ secrets.GITHUB_TOKEN }} - agree-to-terms: true - destination: artifact - artifact-name: mn + extra-flavors: plateau + github-packages-token: ${{ secrets.METANORMA_CI_PAT_TOKEN }} use-bundler: true - cache-site-for-manifest: metanorma.yml - cache-extra-input: | - sources/xmi/** - sources/liquid_templates/** - sources/guidance/** - - fl-build: - runs-on: ubuntu-latest - needs: build - strategy: - matrix: - env: [{ name: 'ghp', prefix: '/mn-samples-plateau/' }, { name: 'mlit', prefix: '/' }] - document: [{ dir: "001", url: "plateaudocument", workspaceTitle: "3D都市モデル標準製品仕様書" }, { dir: "002", url: "plateaudocument02", workspaceTitle: "3D都市モデル標準作業手順書" }] - name: Firelight build - Document ${{ matrix.document.dir }} on ${{ matrix.env.name }} - - steps: - - name: Checkout - uses: actions/checkout@v6 - - - uses: actions/setup-node@v4 - with: - node-version: '22' - - - name: Download Metanorma artifacts - uses: actions/download-artifact@v7 - with: - name: mn - - - name: "Firelight: create temporary Git repo" - run: | - git config --global user.email "57123902+metanorma-ci@users.noreply.github.com" - 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", - "workspaceTitle": "${{ matrix.document.workspaceTitle }}", - "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 ${{ matrix.document.dir }}" - - name: "Firelight: generate HTML for doc ${{ matrix.document.dir }}" - env: - NODE_OPTIONS: "--max_old_space_size=8192" - run: | - npx --node-options='--experimental-vm-modules --max_old_space_size=6144' \ - -y @riboseinc/anafero-cli@0.0.70 build-site \ - --target-dir dist/${{ matrix.document.url }} \ - --path-prefix ${{ matrix.env.prefix }}${{ matrix.document.url }} \ - --current-rev main - - - name: "Firelight: append HTML overrides for doc ${{ matrix.document.dir }}" - run: | - sed -i '/<\/body>/e cat firelight-overrides/${{ matrix.document.url }}.html' dist/${{ matrix.document.url }}/index.html - - - uses: actions/upload-artifact@v6 - with: - name: fl-${{ matrix.env.name }}-${{ matrix.document.dir }} - path: dist - if-no-files-found: error - - deploy-pages: - if: github.ref_name == github.event.repository.default_branch - 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@v7 + - name: Metanorma generate site + uses: actions-mn/build-and-publish@main with: - pattern: fl-ghp-* - path: dist - merge-multiple: true - - - name: List files in dist - run: ls -l dist - - - name: Upload pages artifact - uses: actions/upload-pages-artifact@v4 - 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 + agree-to-terms: true + destination: artifact