shahoob/functionKit

View on GitHub
.github/workflows/doc.yml

Summary

Maintainability
Test Coverage
name: Documentation

on:
  workflow_dispatch:
      
  release:
    types: [created]

jobs:
  doc:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup Node.js v12
        uses: actions/setup-node@v1
        with:
          node-version: 12

      - name: Get everything ready
        run: npm ci

      - name: Document the code (typedoc)
        run: npm run doc

      - name: Compress the Documentation (for upload)
        uses: montudor/action-zip@v0.1.0
        with:
          args: zip -qq -r docs.zip docs
      
      - name: Upload the Documentation
        uses: actions/upload-artifact@v2
        with:
          name: docs
          path: docs.zip
  publish-ghpages:
    runs-on: ubuntu-latest
    needs: [doc]
    steps:
        - name: Download docs
          uses: actions/download-artifact@v2
          with:
            name: docs
        - name: Extract docs
          uses: montudor/action-zip@v0.1.0
          with:
            args: unzip -qq docs.zip -d docs
        - name: Deploy 🚀
          uses: JamesIves/github-pages-deploy-action@3.6.2
          with:
            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
            BRANCH: gh-pages
            FOLDER: docs
            CLEAN: true