-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (78 loc) · 2.28 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
name: publish
on:
push:
tags:
- v*
jobs:
npm:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup
uses: ./.github/actions/setup
with:
node_version: '14'
- name: Publish
uses: JS-DevTools/npm-publish@v1
with:
access: public
token: ${{ secrets.NPM_TOKEN }}
github:
runs-on: ubuntu-20.04
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup
uses: ./.github/actions/setup
- name: Publish
uses: JS-DevTools/npm-publish@v1
with:
access: public
token: ${{ secrets.GITHUB_TOKEN }}
registry: https://npm.pkg.github.com
docs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_TOKEN }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
with:
git_user_signingkey: true
git_commit_gpgsign: true
git_committer_name: ${{ secrets.GIT_USER_NAME }}
git_committer_email: ${{ secrets.GIT_USER_EMAIL }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Setup
uses: ./.github/actions/setup
- name: Get version
id: version
run: |
echo "::set-output name=current::$(jq -r '.version' package.json)"
- name: Documentation
run: npm run docs:build
- name: Publish ${{ steps.version.outputs.current }}
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.GH_TOKEN }}
publish_dir: .docs
destination_dir: ${{ steps.version.outputs.current }}
keep_files: true
user_name: ${{ secrets.GIT_USER_NAME }}
user_email: ${{ secrets.GIT_USER_EMAIL }}
- name: Publish latest
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.GH_TOKEN }}
publish_dir: .docs
keep_files: true
user_name: ${{ secrets.GIT_USER_NAME }}
user_email: ${{ secrets.GIT_USER_EMAIL }}