Skip to content

Commit 11703c4

Browse files
authored
more enhancements (#181)
1 parent 4b36a7b commit 11703c4

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

.github/workflows/build-docs.yaml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ on:
66
branches: [main]
77
release:
88
types: [published]
9+
workflow_dispatch:
10+
inputs:
11+
environment:
12+
description: "The environment to deploy to"
13+
required: true
14+
type: choice
15+
default: "staging"
16+
options:
17+
- staging
18+
- production
919

1020
jobs:
1121
build-docs:
@@ -30,8 +40,8 @@ jobs:
3040
- name: Build Docs
3141
run: make all_docs
3242

33-
- name: Deploy (Push to main)
34-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
43+
- name: Deploy (Push to main or Pull Request)
44+
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'staging')
3545
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
3646
with:
3747
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -41,7 +51,7 @@ jobs:
4151
user_email: 41898282+github-actions[bot]@users.noreply.github.com
4252

4353
- name: Deploy (Release)
44-
if: github.event_name == 'release'
54+
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'production')
4555
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
4656
with:
4757
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -52,8 +62,8 @@ jobs:
5262
tag_name: ${{ github.event.release.tag_name }}
5363
tag_message: 'Documentation for release ${{ github.event.release.tag_name }}'
5464

55-
- name: Trigger mintlify workflow (Push to main)
56-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
65+
- name: Trigger mintlify workflow (Push to main or Pull Request)
66+
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'staging')
5767
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
5868
with:
5969
github-token: ${{ secrets.DOCS_WORKFLOW_TOKEN }}
@@ -66,7 +76,7 @@ jobs:
6676
});
6777
6878
- name: Trigger mintlify workflow (Release)
69-
if: github.event_name == 'release'
79+
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'production')
7080
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
7181
with:
7282
github-token: ${{ secrets.DOCS_WORKFLOW_TOKEN }}
@@ -76,8 +86,4 @@ jobs:
7686
repo: 'docs',
7787
workflow_id: 'mintlify-action.yml',
7888
ref: 'main',
79-
inputs: {
80-
version: '${{ github.event.release.tag_name }}',
81-
is_release: 'true'
82-
}
8389
});

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,4 +155,12 @@ checklink/cookies.txt
155155
nbs/_extensions
156156

157157
# VSCode
158-
*.code-workspace
158+
*.code-workspace
159+
160+
docs/*.md
161+
docs/**/*.mdx
162+
163+
docs-scripts
164+
docs/mintlify/examples
165+
166+
.quarto

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,4 @@ uv run pytest
110110
- The docs are automatically generated from the docstrings in the utilsforecast folder.
111111
- To contribute, ensure your docstrings follow the Google style format.
112112
- Once your docstring is correctly written, the documentation framework will scrape it and regenerate the corresponding `.mdx` files and your changes will then appear in the updated docs.
113+
- Make an appropriate entry in the `docs/mintlify/mint.json` file.

0 commit comments

Comments
 (0)