showdownjs/showdown

View on GitHub
.github/workflows/docs.yml

Summary

Maintainability
Test Coverage
name: documentation

on:
  push:
    branches:
      - master
    paths:
      - 'mkdocs.yml'
      - 'docs/**'
      - '.github/workflows/docs.yml'

jobs:
  build_docs:
    name: Build documentation
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Trigger external build
        env:
          TOKEN: ${{ secrets.DOCS_DEPLOY_KEY }}
          COMMIT: ${{ github.event.head_commit.id }}
          COMMITTER: ${{ github.event.head_commit.author.username }}
          OWNER: showdownjs
          REPO: showdownjs.github.io
        run: |
          curl -X POST \
          -H "Authorization: token ${TOKEN}" \
          -H "Accept: application/vnd.github.v3+json" \
          https://api.github.com/repos/${OWNER}/${REPO}/dispatches \
          -d '{ "event_type": "e: \"'"${COMMIT}"'\" by '"${COMMITTER}"'", "client_payload": { "source": "showdown" } }'