Skip to content

Commit d4b46f4

Browse files
committed
Separate build and publish into two jobs
1 parent 7a54da0 commit d4b46f4

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

.github/workflows/generate_docs.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ env:
1111
PACKAGE_TITLE: "Tweening System"
1212

1313
jobs:
14-
generate:
15-
name: Generate Docs
14+
build:
15+
name: Build
1616
runs-on: windows-latest
1717
steps:
1818
- name: Checkout package
@@ -39,34 +39,53 @@ jobs:
3939
args: install docfx
4040

4141
- name: Setup node
42-
uses: actions/setup-node@v2
42+
uses: actions/setup-node@v3
4343
with:
4444
node-version: '14'
45+
cache: 'yarn'
46+
cache-dependency-path: docs~/yarn.lock
4547

4648
- name: Install dependencies
4749
working-directory: docs~
48-
run: npm install
50+
run: yarn install
4951
env:
5052
NPM_TOKEN: ${{ secrets.DOCS_TOKEN }}
5153

5254
- name: Generate documentation
5355
working-directory: docs~
54-
run: npm run-script generate $env:BASE_PATH $env:PACKAGE_TITLE
56+
run: yarn generate $env:BASE_PATH $env:PACKAGE_TITLE
5557
env:
5658
NPM_TOKEN: ${{ secrets.DOCS_TOKEN }}
5759

5860
- name: Build docs
5961
working-directory: docs~
6062
continue-on-error: false
61-
run: npm run-script build
63+
run: yarn build
6264
env:
6365
NPM_TOKEN: ${{ secrets.DOCS_TOKEN }}
6466

67+
- name: Upload artifact
68+
uses: actions/upload-artifact@v3
69+
with:
70+
name: docs
71+
path: docs~/public
72+
73+
publish:
74+
name: Publish
75+
needs: build
76+
runs-on: windows-latest
77+
steps:
78+
- name: Download artifact
79+
uses: actions/download-artifact@v3
80+
with:
81+
name: docs
82+
path: docs
83+
6584
- name: Publish
6685
uses: peaceiris/actions-gh-pages@v3
6786
with:
6887
personal_token: ${{ secrets.DOCS_TOKEN }}
6988
external_repository: zigurous/docs
7089
destination_dir: ${{ env.BASE_PATH }}
71-
publish_dir: docs~/public
90+
publish_dir: docs
7291
publish_branch: main

0 commit comments

Comments
 (0)