daisy 0.11.0

A board support package for the Electro-Smith Daisy Seed and Patch SM
name: Documentation deployment

on:
  push:
    tags: ["*"]
  workflow_dispatch:

env:
  CARGO_TERM_COLOR: always

permissions:
  contents: write
  pages: write
  id-token: write

concurrency:
  group: "pages"
  cancel-in-progress: true

jobs:
  check:
    runs-on: ubuntu-latest
    outputs:
      branch: ${{ steps.check_step.outputs.branch }}
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Get current branch
        id: check_step
        run: |
          raw=$(git branch -r --contains ${{ github.ref }})
          branch=${raw##*/}
          echo "branch=${branch}" >> ${GITHUB_OUTPUT}
          echo "Branch is $branch."    
  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    needs: check
    if: ${{ needs.check.outputs.branch == 'main' }}
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Setup Pages
        uses: actions/configure-pages@v2
      - name: Install ARM Rust toolchain
        uses: actions-rs/toolchain@v1
        with:
          target: thumbv7em-none-eabihf
          toolchain: stable
          override: true
      - name: Build documentation
        run: OUTPUT=_docs hack/build-docs.sh
      - name: Upload artifact
        uses: actions/upload-pages-artifact@v1
        with:
          path: _docs/
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v1