Skip to content

Commit e980006

Browse files
authored
Publish latest/next docs in separate job (#634)
1 parent 13b6137 commit e980006

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

.github/workflows/publish-npm.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,19 @@ jobs:
4242
npm ci
4343
npm run build
4444
npm pack
45+
4546
- name: Publish @next
4647
run: npm publish --tag next
4748
if: "github.event.release.prerelease"
4849
env:
4950
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
51+
5052
- name: Publish @latest
5153
run: npm publish --tag latest
5254
if: "!github.event.release.prerelease"
5355
env:
5456
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
57+
5558
- name: Upload chartjs-plugin-zoom.tgz
5659
uses: actions/upload-release-asset@v1
5760
env:
@@ -61,6 +64,7 @@ jobs:
6164
asset_path: ${{ format('chartjs-plugin-zoom-{0}.tgz', needs.setup.outputs.version) }}
6265
asset_name: ${{ format('chartjs-plugin-zoom-{0}.tgz', needs.setup.outputs.version) }}
6366
asset_content_type: application/gzip
67+
6468
- name: Upload chartjs-plugin-zoom.js
6569
uses: actions/upload-release-asset@v1
6670
env:
@@ -70,6 +74,7 @@ jobs:
7074
asset_path: dist/chartjs-plugin-zoom.js
7175
asset_name: chartjs-plugin-zoom.js
7276
asset_content_type: application/javascript
77+
7378
- name: Upload chartjs-plugin-zoom.min.js
7479
uses: actions/upload-release-asset@v1
7580
env:
@@ -79,25 +84,48 @@ jobs:
7984
asset_path: dist/chartjs-plugin-zoom.min.js
8085
asset_name: chartjs-plugin-zoom.min.js
8186
asset_content_type: application/javascript
82-
- name: Build docs
87+
88+
- name: Build docs (version)
8389
run: |
8490
./scripts/docs-config.sh "$VERSION" release
8591
npm run docs
8692
env:
8793
VERSION: ${{ needs.setup.outputs.version }}
94+
8895
- name: Release to GitHub Pages (version)
8996
uses: peaceiris/actions-gh-pages@v3
9097
with:
9198
github_token: ${{ secrets.GH_AUTH_TOKEN }}
9299
publish_dir: dist/docs
93100
destination_dir: ${{ needs.setup.outputs.version }}
101+
102+
publish-docs:
103+
needs: [test, setup]
104+
runs-on: ubuntu-latest
105+
steps:
106+
- uses: actions/checkout@v2
107+
- uses: actions/setup-node@v2
108+
with:
109+
node-version: 16
110+
registry-url: https://registry.npmjs.org/
111+
112+
- name: Build docs (latest/next)
113+
run: |
114+
npm ci
115+
npm run build
116+
./scripts/docs-config.sh "$VERSION"
117+
npm run docs
118+
env:
119+
VERSION: ${{ needs.setup.outputs.version }}
120+
94121
- name: Release to GitHub Pages (latest)
95122
if: "!github.event.release.prerelease"
96123
uses: peaceiris/actions-gh-pages@v3
97124
with:
98125
github_token: ${{ secrets.GH_AUTH_TOKEN }}
99126
publish_dir: dist/docs
100127
destination_dir: latest
128+
101129
- name: Release to GitHub Pages (next)
102130
if: "github.event.release.prerelease"
103131
uses: peaceiris/actions-gh-pages@v3

0 commit comments

Comments
 (0)