name: Release docs

on:
  push:
    tags:
      - v*

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Ensure `develop` branch
      run: |
        git fetch --depth=5 origin develop
        git merge-base --is-ancestor ${{ github.sha }} develop
    - run: npm ci --ignore-scripts
    - run: npm run build:docs
    - name: Make GitHub links absolute
      run: >
        shopt -s globstar;
        sed
          --in-place
          --expression='s:/develop/docs/:/${{ github.sha }}/docs/:g'
          docs/build/**/*.html;
    - name: Deploy to GitHub Pages
      uses: peaceiris/actions-gh-pages@v3
      with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./docs/build
          # for v3.html and perhaps CNAME
          keep_files: true

name: Release docs

on:
  push:
    tags:
      - v*

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - run: npm ci --ignore-scripts
    - run: npm run build:docs
    - name: Make GitHub links absolute
      run: >
        shopt -s globstar;
        sed
          --in-place
          --expression='s:/develop/docs/:/${{ github.sha }}/docs/:g'
          docs/build/**/*.html;
    - name: Deploy to GitHub Pages
      uses: peaceiris/actions-gh-pages@v3
      with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./docs/build
          # for v3.html and perhaps CNAME
          keep_files: true

Revert "Publish docs only for `develop` commits"
Revert "Publish docs only for `develop` commits"

This reverts commit 792b3290015f0e06ebfcdb495d77318198b1ab44.
