aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/update-docs.yml
blob: 813e69c3028151be951dad697de0da8c31334664 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Update docs

on: push

jobs:
  update-readme:
    name: Update docs
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3
        with:
          submodules: true

      - name: Install Neovim and dependencies
        env:
          NVIM_TAG: v0.8.3
        run: |
          bash ./.github/workflows/install_nvim.sh

      - name: Update docs
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          COMMIT_MSG: |
            [docgen] Update docs
            skip-checks: true
        run: |
          git config user.email "actions@github"
          git config user.name "Github Actions"
          git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
          python -m pip install pyparsing==3.0.9
          python .github/main.py generate
          python .github/main.py lint
          git add README.md doc
          # Only commit and push if we have changes
          git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin HEAD:${GITHUB_REF})