diff --git a/.github/workflows/upload-docs.yaml b/.github/workflows/upload-docs.yaml new file mode 100644 index 000000000..2cf962d20 --- /dev/null +++ b/.github/workflows/upload-docs.yaml @@ -0,0 +1,76 @@ +name: Upload Docs + +on: + push: + branches: + - main + - docs/gh-pages + +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: 1.81.0 + + - name: Setup cargo cache + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- + + - name: Build Documentation + run: | + # Build docs for all workspace members + cargo doc --no-deps --workspace + + # Create an index.html that redirects to the main crate's docs + echo '' > target/doc/index.html + + # Copy the generated docs to the pages directory + mkdir -p pages + cp -r target/doc/* pages/ + + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: pages + + deploy: + needs: build + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + diff --git a/README.md b/README.md index 0cf18e1cd..0eae03dd4 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,10 @@ This repo implements Axelar's [cross-chain gateway protocol](https://github.com/ > Check configuration for CLI and Identity before deployment: https://developers.stellar.org/docs/build/smart-contracts/getting-started/setup +## Docs + +Rustdocs for this workspace can be found [here](https://axelarnetwork.github.io/axelar-cgp-soroban). + ## Install Install Soroban CLI