name: Release

on:
  push:
    branches: [master,main]
    tags: ["*"]

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2.3.4
        with:
          fetch-depth: 0
      - uses: cachix/install-nix-action@v12

      - name: Lint check
        run: nix-shell --run 'sbt -Dsbt.supershell=false check'

      - name: Publish ${{ github.ref }}
        run: nix-shell --run 'sbt -Dsbt.supershell=false ci-release'
        env:
          PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
          PGP_SECRET: ${{ secrets.PGP_SECRET }}
          SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
          SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

      - name: Build website
        run: nix-shell --run 'sbt docs/docusaurusCreateSite'

      - name: Publish gh-pages
        uses: peaceiris/actions-gh-pages@v3
        with:
          deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
          publish_dir: ./website/build
          force_orphan: true

name: Release

on:
  push:
    branches: [master,main]
    tags: ["*"]

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2.3.4
        with:
          fetch-depth: 0
      - uses: cachix/install-nix-action@v12

      - name: Lint check
        run: nix-shell --run 'sbt -Dsbt.supershell=false check'

      - name: Publish ${{ github.ref }}
        run: nix-shell --run 'sbt -Dsbt.supershell=false ci-release'
        env:
          PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
          PGP_SECRET: ${{ secrets.PGP_SECRET }}
          SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
          SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

      - name: Build website
        run: nix-shell --run 'sbt docs/docusaurusCreateSite'

      - name: Publish gh-pages
        run: nix-shell --run 'sbt -Dsbt.supershell=false sbt/docusaurusPublishGhpages'
        env:
          GIT_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}

Use mdoc plugin to deploy site to gh-pages
Use mdoc plugin to deploy site to gh-pages
