sonata 0.1.1

The static site generator.
Documentation
name: "Install sonata"
description: "Install sonata, the static site generator."
branding:
  icon: book-open
  color: orange

inputs:
  version:
    required: true
    description: The version of sonata to install
    default: "0.1.1"

runs:
  using: composite
  steps:
    - uses: actions/cache@v3
      with:
        path: ~/.cargo/bin/sonata
        key: sonata-${{ inputs.version }}-${{ runner.os }}
        restore-keys: sonata-${{ inputs.version }}

    - name: Find sonata
      id: cache
      shell: bash
      run: |
        BIN=~/.cargo/bin/sonata
        if [ -f $BIN ]; then
          VERSION=$($BIN --version)
          if [ "$VERSION" -nq ${{ inputs.version }} ]; then
            echo "skip=false" >> "$GITHUB_OUTPUT"
          fi
        else
          echo "skip=false" >> "$GITHUB_OUTPUT"
        fi

    - name: Install rust-toolchain
      id: install-rust
      if: ${{ steps.cache.outputs.skip == 'false' }}
      uses: dtolnay/rust-toolchain@stable

    - name: Install sonata
      if: ${{ steps.cache.outputs.skip == 'false' }}
      shell: bash
      run: cargo install sonata --version ${{ inputs.version }}