diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 5b3d84e98b..01b4a4b5fc 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -3,30 +3,28 @@ name: Documentation on: push: branches: - - develop + - tmp-develop tags: - 'v*' - paths: - - 'website/**' - - 'docs/**' - - '.github/workflows/docs.yaml' pull_request: - paths: - - 'website/**' - - 'docs/**' - - '.github/workflows/docs.yaml' workflow_dispatch: env: NODE_VERSION: '20' +permissions: + contents: read + actions: write + pages: write + id-token: write + concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: # Test documentation build - test-docs: + docs-build: runs-on: ubuntu-latest steps: - name: Checkout repository @@ -57,63 +55,34 @@ jobs: run: make docs-build - name: Upload build artifacts for testing - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: - name: docs-build-test + name: github-pages path: website/build - retention-days: 1 # Deploy to GitHub Pages (only on develop branch) deploy: - if: github.ref == 'refs/heads/develop' && github.event_name == 'push' - needs: [test-docs] + if: github.ref == 'refs/heads/tmp-develop' && github.event_name == 'push' + needs: [docs-build] runs-on: ubuntu-latest environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - permissions: - contents: read - pages: write - id-token: write - steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 # Full history for versioning - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - cache: 'npm' - cache-dependency-path: website/package-lock.json - - name: Setup Pages - uses: actions/configure-pages@v4 - - - name: Setup build dependencies - run: | - sudo apt update - sudo apt install -y protobuf-compiler + uses: actions/configure-pages@v5 - - name: Install documentation dependencies - run: make docs-install - - - name: Build documentation - run: | - cd website - # Set base URL for GitHub Pages - echo "Building documentation for GitHub Pages..." - npm run build - env: - NODE_ENV: production - - - name: Upload to GitHub Pages - uses: actions/upload-pages-artifact@v3 + - name: Download built docs + uses: actions/download-artifact@v3 with: + name: github-pages path: website/build - name: Deploy to GitHub Pages @@ -123,7 +92,7 @@ jobs: # Create versioned documentation on tag creation version-docs: if: startsWith(github.ref, 'refs/tags/v') - needs: [test-docs] + needs: [docs-build] runs-on: ubuntu-latest steps: - name: Checkout repository @@ -132,12 +101,19 @@ jobs: fetch-depth: 0 - name: Setup Node.js + uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} cache: 'npm' cache-dependency-path: website/package-lock.json + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + toolchain: nightly + - name: Install dependencies run: make docs-install @@ -161,8 +137,7 @@ jobs: - name: Build versioned documentation run: | - cd website - npm run build + make docs-build env: NODE_ENV: production diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts index c8bf8bc7da..a92511434c 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -23,7 +23,7 @@ const config: Config = { // GitHub pages deployment config. // If you aren't using GitHub pages, you don't need these. organizationName: 'o1-labs', // Usually your GitHub org/user name. - projectName: 'openmina', // Usually your repo name. + projectName: 'o1-labs.github.io/openmina', // GH address + repository onBrokenLinks: 'throw', // Throw error on broken links to enforce link integrity onBrokenMarkdownLinks: 'throw',