File: docspublish.yml

package info (click to toggle)
commitizen 4.11.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,912 kB
  • sloc: python: 17,743; makefile: 15
file content (77 lines) | stat: -rw-r--r-- 2,328 bytes parent folder | download
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Publish documentation

on:
  push:
    branches:
      - master
  workflow_dispatch:

jobs:
  update-cli-screenshots:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
          fetch-depth: 0
      - name: Set up Python
        uses: actions/setup-python@v6
        with:
          python-version: "3.x"
      - name: Install dependencies
        run: |
          python -m pip install -U pip poetry poethepoet
          poetry --version
          poetry install --only main,script
      - name: Update CLI screenshots
        run: |
          poetry doc:screenshots
      - name: Commit and push updated CLI screenshots
        run: |
          git config --global user.name "github-actions[bot]"
          git config --global user.email "github-actions[bot]@users.noreply.github.com"
          git add docs/images/cli_help

          if [[ -n "$(git status --porcelain)" ]]; then
            git commit -m "docs(cli/screenshots): update CLI screenshots" -m "[skip ci]"
            git push
          else
            echo "No changes to commit. Skipping."
          fi

  publish-documentation:
    runs-on: ubuntu-latest
    needs: update-cli-screenshots
    steps:
      - uses: actions/checkout@v6
        with:
          token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
          fetch-depth: 0
      - name: Pull latest changes
        run: |
          git pull origin master
      - name: Set up Python
        uses: actions/setup-python@v6
        with:
          python-version: "3.x"
      - name: Install dependencies
        run: |
          python -m pip install -U pip poetry poethepoet
          poetry --version
          poetry install --no-root --only documentation
      - name: Generate Sponsors 💖
        uses: JamesIves/github-sponsors-readme-action@v1
        with:
          token: ${{ secrets.PERSONAL_ACCESS_TOKEN_FOR_ORG }}
          file: "docs/README.md"
          organization: true
      - name: Build docs
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          poetry doc:build
      - name: Deploy 🚀
        uses: JamesIves/github-pages-deploy-action@v4
        with:
          folder: ./site # The folder the action should deploy.
          branch: gh-pages