-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (52 loc) · 1.54 KB
/
npm-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
# use this action(https://github.com/JamesIves/github-pages-deploy-action)
name: page Build and Deploy
on:
push:
branches:
- main
permissions:
contents: write # Workflow permissions. permissions granted to the GITHUB_TOKEN when running workflows in this repository
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: install pnpm
run: |
npm install -g pnpm@8
pnpm install && pnpm build
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.3.3
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs # The folder the action should deploy.
clean: true
publish-npm:
needs: build-and-deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
publish-gpr:
needs: build-and-deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.git_token}}