From 7340eb854628bbcb0ad694eae9657accb19047a6 Mon Sep 17 00:00:00 2001 From: andrussal Date: Wed, 3 Dec 2025 05:03:15 +0100 Subject: [PATCH] Publish book to Pages only after successful build --- .github/workflows/build-binaries.yml | 18 ++++++++++++++---- .github/workflows/lint.yml | 24 ++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 5c8a827..873b6be 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -9,10 +9,14 @@ env: jobs: build_nomos_binaries: - runs-on: - - self-hosted - - macOS - - X64 + strategy: + matrix: + include: + - name: macos + runs-on: [self-hosted, macOS, X64] + - name: linux + runs-on: ubuntu-latest + runs-on: ${{ matrix.runs-on }} env: NOMOS_CIRCUITS: ${{ github.workspace }}/.tmp/nomos-circuits CARGO_INCREMENTAL: 0 @@ -21,6 +25,12 @@ jobs: CARGO_TARGET_DIR: ${{ github.workspace }}/.tmp/nomos-target steps: - uses: actions/checkout@v4 + - name: Install system dependencies (Linux) + if: runner.os == 'Linux' + run: | + set -euo pipefail + sudo apt-get update + sudo apt-get install -y clang llvm-dev libclang-dev pkg-config cmake libssl-dev rsync libgmp10 libgmp-dev libgomp1 nasm - name: Install nomos circuits run: | ./scripts/setup-nomos-circuits.sh v0.3.1 "$NOMOS_CIRCUITS" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f9e4369..17bd610 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,6 +8,10 @@ on: env: CARGO_TERM_COLOR: always NOMOS_NODE_REV: 2f60a0372c228968c3526c341ebc7e58bbd178dd +permissions: + contents: read + pages: write + id-token: write concurrency: group: lint-${{ github.ref }} @@ -431,3 +435,23 @@ jobs: run: mdbook build book - name: Check links run: mdbook-linkcheck book + - name: Upload book artifact for Pages + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + uses: actions/upload-pages-artifact@v3 + with: + path: book/book + + deploy_book: + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + needs: book + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + permissions: + pages: write + id-token: write + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4