diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d464414c6..826ee22620 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,3 +68,43 @@ jobs: - run: git config user.email ci@sel4.systems - run: git commit -m "auto-deployed" - run: git push + + # Push platforms.json to the website repo if changed + platforms-push: + if: ${{ github.repository_owner == 'seL4' && + (github.event_name == 'push' || github.event_name == 'schedule' || + github.event_name == 'workflow_dispatch') }} + needs: build + name: 'Update platforms.json on website' + runs-on: ubuntu-24.04 + steps: + # fetch only _data/ and top-level files, not the full repo and no large files + - name: Check out website repo + uses: actions/checkout@v6 + with: + repository: seL4/website + path: website + token: ${{ secrets.PRIV_REPO_TOKEN }} + fetch-depth: 1 + filter: blob:none + sparse-checkout: _data + - uses: actions/download-artifact@v8 + with: + name: site + - name: Unpack site + run: tar -xvf site.tar _site/Hardware/platforms.json + - name: Validate json + run: jq empty _site/Hardware/platforms.json + - name: Push to website + run: | + cp _site/Hardware/platforms.json website/_data/platforms.json + cd website + git add _data/platforms.json + if git diff --cached --quiet; then + echo "platforms.json unchanged" + exit 0 + fi + git config user.name "seL4 CI" + git config user.email "ci@sel4.systems" + git commit -s -m "CI: update platforms from docsite" + git push origin HEAD:master diff --git a/Hardware/platforms.json b/Hardware/platforms.json index 949804bf5a..5121c5c13c 100644 --- a/Hardware/platforms.json +++ b/Hardware/platforms.json @@ -3,34 +3,10 @@ layout: null SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2025 seL4 International --- - +{%- assign arm = site.pages | where_exp: "p", "p.arm_hardware and p.Maintained" | sort: "platform" | map: "platform" %} +{%- assign riscv = site.pages | where_exp: "p", "p.riscv_hardware and p.Maintained" | sort: "platform" | map: "platform" %} [ - [ - "Arm", - [ -{%- assign sorted = site.pages | sort: 'platform' %} -{%- for page in sorted %} -{%- if page.arm_hardware and page.Maintained %} - "{{ page.platform }}"{% unless forloop.last %},{% endunless %} -{%- endif %} -{%- endfor %} - ] - ], - [ - "RISC-V", - [ -{%- assign sorted = site.pages | sort: 'platform' %} -{%- for page in sorted %} -{%- if page.riscv_hardware and page.Maintained %} - "{{ page.platform }}"{% unless forloop.last %},{% endunless %} -{%- endif %} -{%- endfor %} - ] - ], - [ - "Intel", - [ - "32 and 64 bit PC-99 machines" - ] - ] + ["Arm", {{ arm | jsonify }}], + ["RISC-V", {{ riscv | jsonify }}], + ["Intel", ["32 and 64 bit PC-99 machines"]] ]