Skip to content

Commit 8da3293

Browse files
committed
Dispatch workflow to publish docs
1 parent 1eb6929 commit 8da3293

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

.github/workflows/generate_docs.yml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ jobs:
4141
- name: Setup node
4242
uses: actions/setup-node@v3
4343
with:
44-
node-version: '14'
45-
cache: 'yarn'
44+
node-version: 14
45+
cache: yarn
4646
cache-dependency-path: docs~/yarn.lock
4747

4848
- name: Install dependencies
@@ -75,17 +75,20 @@ jobs:
7575
needs: build
7676
runs-on: windows-latest
7777
steps:
78-
- name: Download artifact
79-
uses: actions/download-artifact@v3
78+
- name: Dispatch workflow
79+
uses: actions/github-script@v6
8080
with:
81-
name: docs
82-
path: docs
83-
84-
- name: Publish
85-
uses: peaceiris/actions-gh-pages@v3
86-
with:
87-
personal_token: ${{ secrets.DOCS_TOKEN }}
88-
external_repository: zigurous/docs
89-
destination_dir: ${{ env.BASE_PATH }}
90-
publish_dir: docs
91-
publish_branch: main
81+
github-token: ${{ secrets.DOCS_TOKEN }}
82+
script: |
83+
await github.rest.actions.createWorkflowDispatch({
84+
owner: 'zigurous',
85+
repo: 'docs',
86+
ref: 'main',
87+
workflow_id: 'publish.yml',
88+
inputs: {
89+
path: process.env.BASE_PATH,
90+
repo: process.env.GITHUB_REPOSITORY,
91+
commit: context.sha,
92+
workflow: 'generate_docs.yml'
93+
}
94+
})

0 commit comments

Comments
 (0)