on:
  release:
    types:
      - released
name: Documentation
jobs:
  build:
    name: Publish
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v6.0.3

    - uses: actions/setup-node@v4
      with:
        node-version: '12.x'

    - name: Build Library and Docs
      run: ./scripts/build

    - name: Deploy
      if: success()
      # use the specific sha of 3rd party libraries for security reasons https://julienrenaux.fr/2019/12/20/github-actions-security-risk/
      # Using tag v5.0.0
      uses: crazy-max/ghaction-github-pages@1d6ee9b181a81033a16bd707a1401afa978daab4
      with:
        target_branch: gh-pages
        build_dir: ./docs
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

