chore: update Cargo.lock for v0.5.0 #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Documentation | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| # Build and test documentation | |
| build-docs: | |
| name: Build Documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Generate API documentation | |
| run: cargo doc --all-features --no-deps | |
| - name: Upload documentation artifacts | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: api-docs | |
| path: target/doc/ | |
| # Deploy to GitHub Pages (only on main branch) | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| runs-on: ubuntu-latest | |
| needs: build-docs | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Generate API documentation | |
| run: cargo doc --all-features --no-deps | |
| - name: Setup mdBook | |
| uses: peaceiris/actions-mdbook@v1 | |
| with: | |
| mdbook-version: 'latest' | |
| - name: Build documentation site | |
| run: | | |
| # Create a simple documentation site | |
| mkdir -p docs | |
| cat > docs/index.md << 'EOF' | |
| # Leptos Query Documentation | |
| Welcome to the Leptos Query documentation! | |
| ## Quick Links | |
| - [API Reference](./api/) | |
| - [Examples](../examples/) | |
| - [Migration Guide](../docs/migration.md) | |
| - [GitHub Repository](https://github.com/cloud-shuttle/leptos-query) | |
| ## Installation | |
| Add to your `Cargo.toml`: | |
| ```toml | |
| [dependencies] | |
| leptos-query = "0.1.0" | |
| ``` | |
| ## Quick Start | |
| ```rust | |
| use leptos::*; | |
| use leptos_query::*; | |
| #[component] | |
| fn UserProfile(user_id: u32) -> impl IntoView { | |
| let user_query = use_query( | |
| move || &["users", &user_id.to_string()][..], | |
| move || || async move { fetch_user(user_id).await }, | |
| QueryOptions::default() | |
| ); | |
| // ... rest of component | |
| } | |
| ``` | |
| EOF | |
| cat > book.toml << 'EOF' | |
| [book] | |
| authors = ["CloudShuttle Team"] | |
| language = "en" | |
| multilingual = false | |
| src = "docs" | |
| title = "Leptos Query" | |
| [output.html] | |
| git-repository-url = "https://github.com/cloud-shuttle/leptos-query" | |
| git-repository-icon = "fa-github" | |
| EOF | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./book-docs/book | |
| destination_dir: . |