|
4 | 4 | branches: [main] |
5 | 5 | pull_request: |
6 | 6 | branches: [main] |
7 | | - |
8 | | -env: |
9 | | - QUARTO_PREVIEW: "1" |
| 7 | + release: |
| 8 | + types: [published] |
10 | 9 |
|
11 | 10 | jobs: |
12 | 11 | build-docs: |
|
32 | 31 | - name: Build Docs |
33 | 32 | run: make all_docs |
34 | 33 |
|
35 | | - - name: Deploy |
36 | | - if: github.event_name == 'push' |
| 34 | + - name: Deploy (Push to main or Pull Request) |
| 35 | + if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'pull_request' |
| 36 | + uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 |
| 37 | + with: |
| 38 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 39 | + publish_branch: docs-preview |
| 40 | + publish_dir: docs/mintlify |
| 41 | + user_name: github-actions[bot] |
| 42 | + user_email: 41898282+github-actions[bot]@users.noreply.github.com |
| 43 | + |
| 44 | + - name: Deploy (Release) |
| 45 | + if: github.event_name == 'release' |
37 | 46 | uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 |
38 | 47 | with: |
39 | 48 | github_token: ${{ secrets.GITHUB_TOKEN }} |
|
42 | 51 | user_name: github-actions[bot] |
43 | 52 | user_email: 41898282+github-actions[bot]@users.noreply.github.com |
44 | 53 |
|
45 | | - - name: Trigger mintlify workflow |
46 | | - if: github.event_name == 'push' |
| 54 | + - name: Trigger mintlify workflow (Push to main or Pull Request) |
| 55 | + if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'pull_request' |
| 56 | + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 |
| 57 | + with: |
| 58 | + github-token: ${{ secrets.DOCS_WORKFLOW_TOKEN }} |
| 59 | + script: | |
| 60 | + await github.rest.actions.createWorkflowDispatch({ |
| 61 | + owner: 'nixtla', |
| 62 | + repo: 'docs', |
| 63 | + workflow_id: 'mintlify-action-preview.yml', |
| 64 | + ref: 'main', |
| 65 | + }); |
| 66 | +
|
| 67 | + - name: Trigger mintlify workflow (Release) |
| 68 | + if: github.event_name == 'release' |
47 | 69 | uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 |
48 | 70 | with: |
49 | 71 | github-token: ${{ secrets.DOCS_WORKFLOW_TOKEN }} |
|
0 commit comments