|
58 | 58 | working-directory: bindings/python |
59 | 59 | run: | |
60 | 60 | pip install --upgrade pip |
61 | | - pip install mkdocs-material mkdocs-git-revision-date-localized-plugin |
| 61 | + pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mike |
62 | 62 |
|
63 | 63 | - name: Validate docs token |
64 | 64 | if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' |
@@ -93,45 +93,42 @@ jobs: |
93 | 93 | token: ${{ secrets.HUMEMAI_DOCS_TOKEN }} |
94 | 94 | path: humemai-docs |
95 | 95 |
|
96 | | - - name: Build documentation |
97 | | - if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' |
98 | | - working-directory: bindings/python |
| 96 | + - name: Deploy with mike (set as latest) |
| 97 | + if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && steps.version.outputs.set_latest == 'true' |
| 98 | + working-directory: humemai-docs |
99 | 99 | env: |
100 | 100 | MIKE_VERSION: ${{ steps.version.outputs.version }} |
101 | 101 | run: | |
102 | | - mkdocs build -f mkdocs.yml -d /tmp/site |
| 102 | + mike deploy --update-aliases \ |
| 103 | + --deploy-prefix arcadedb \ |
| 104 | + --branch ${{ env.DOCS_BRANCH }} \ |
| 105 | + --config-file ../bindings/python/mkdocs.yml \ |
| 106 | + ${{ steps.version.outputs.version }} latest \ |
| 107 | + --title "${{ steps.version.outputs.version }}" |
| 108 | + mike set-default \ |
| 109 | + --deploy-prefix arcadedb \ |
| 110 | + --branch ${{ env.DOCS_BRANCH }} \ |
| 111 | + latest |
103 | 112 |
|
104 | | - - name: Publish docs to humemai-docs |
| 113 | + - name: Deploy with mike (not latest) |
| 114 | + if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && steps.version.outputs.set_latest != 'true' |
| 115 | + working-directory: humemai-docs |
| 116 | + env: |
| 117 | + MIKE_VERSION: ${{ steps.version.outputs.version }} |
| 118 | + run: | |
| 119 | + mike deploy \ |
| 120 | + --deploy-prefix arcadedb \ |
| 121 | + --branch ${{ env.DOCS_BRANCH }} \ |
| 122 | + --config-file ../bindings/python/mkdocs.yml \ |
| 123 | + ${{ steps.version.outputs.version }} \ |
| 124 | + --title "${{ steps.version.outputs.version }}" |
| 125 | +
|
| 126 | + - name: Commit and push docs |
105 | 127 | if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' |
| 128 | + working-directory: humemai-docs |
106 | 129 | env: |
107 | 130 | VERSION: ${{ steps.version.outputs.version }} |
108 | | - SET_LATEST: ${{ steps.version.outputs.set_latest }} |
109 | 131 | run: | |
110 | | - set -e |
111 | | - DEST="humemai-docs/arcadedb/${VERSION}" |
112 | | - mkdir -p "$DEST" |
113 | | - rsync -a --delete /tmp/site/ "$DEST/" |
114 | | -
|
115 | | - if [ "$SET_LATEST" = "true" ]; then |
116 | | - mkdir -p humemai-docs/arcadedb/latest |
117 | | - rsync -a --delete /tmp/site/ humemai-docs/arcadedb/latest/ |
118 | | - cat > humemai-docs/arcadedb/index.html <<'EOF' |
119 | | - <!doctype html> |
120 | | - <html lang="en"> |
121 | | - <head> |
122 | | - <meta charset="utf-8" /> |
123 | | - <meta http-equiv="refresh" content="0; url=/arcadedb/latest/" /> |
124 | | - <meta name="robots" content="noindex" /> |
125 | | - <title>Redirecting…</title> |
126 | | - </head> |
127 | | - <body> |
128 | | - <p>Redirecting to <a href="/arcadedb/latest/">/arcadedb/latest/</a></p> |
129 | | - </body> |
130 | | - </html> |
131 | | - EOF |
132 | | - fi |
133 | | -
|
134 | | - cd humemai-docs |
135 | 132 | git config user.name "github-actions[bot]" |
136 | 133 | git config user.email "github-actions[bot]@users.noreply.github.com" |
137 | 134 | git add arcadedb |
|
0 commit comments