Skip to content

Commit 1b67038

Browse files
committed
build: add package publish action
1 parent 3458af1 commit 1b67038

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

.github/workflows/deploy.yml

+17-3
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,28 @@ jobs:
1919
- uses: actions/setup-node@v3
2020
with:
2121
node-version-file: '.nvmrc'
22-
22+
2323
- run: npm ci
2424

25+
- run: npm run package
26+
27+
- name: Publish if version has been updated
28+
uses: pascalgn/npm-publish-action@1.3.9
29+
with:
30+
tag_name: "%s"
31+
create_tag: "true"
32+
commit_pattern: "^chore: release (\\S+)"
33+
workspace: "./dist/ng-tagcanvas"
34+
publish_command: "npm"
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
38+
2539
- run: npm run build -- --base-href /ng-tagcanvas/ --deploy-url /ng-tagcanvas/
2640

27-
- name: Deploy
41+
- name: Deploy page
2842
uses: peaceiris/actions-gh-pages@v3
2943
if: github.ref == 'refs/heads/master'
3044
with:
3145
github_token: ${{ secrets.GITHUB_TOKEN }}
32-
publish_dir: ./dist/ng-tagcanvas-example
46+
publish_dir: ./dist/ng-tagcanvas-example

0 commit comments

Comments
 (0)