Skip to content

Commit 714dfad

Browse files
committed
Make CI Smarter
1 parent d03092b commit 714dfad

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
name: Deploy VitePress site to Pages
44

55
on:
6-
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
7-
# using the `master` branch as the default branch.
86
push:
97
branches: [main]
8+
paths:
9+
- 'package.json'
10+
- 'package-lock.json'
11+
- 'docs/**'
1012

11-
# Allows you to run this workflow manually from the Actions tab
13+
# Allows to run this workflow manually from the Actions tab
1214
workflow_dispatch:
1315

1416
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages

.github/workflows/publish-to-npm.yml renamed to .github/workflows/release.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@ jobs:
2222
run: npm run test
2323
- name: Prepack
2424
run: npm run prepack
25+
# Configure Git for automated commits
2526
- name: Configuring Git
2627
run: git config --global user.name "GitHub CD bot" && git config --global user.email "[email protected]"
28+
# Bump package version
2729
- name: Update package version
2830
run: npm --no-git-tag-version version ${{ github.event.release.tag_name }}
29-
# - name: Publish package to NPM
30-
# run: npm publish
31-
# env:
32-
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
31+
# Publish package to NPM
32+
- name: Publish package to NPM
33+
run: npm publish
34+
env:
35+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
36+
# Push changes to GitHub (package.json and package-lock.json)
3337
- name: Push changes to GitHub
3438
run: git commit -am "Release ${{ github.event.release.tag_name }}" && git push origin HEAD:main

.github/workflows/run-tests.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,21 @@ on:
44
push:
55
branches:
66
- main
7+
paths:
8+
- 'package.json'
9+
- 'package-lock.json'
10+
- 'src/**'
11+
- 'test/**'
12+
- 'playground/**'
713
pull_request:
814
branches:
915
- main
16+
paths:
17+
- 'package.json'
18+
- 'package-lock.json'
19+
- 'src/**'
20+
- 'test/**'
21+
- 'playground/**'
1022

1123
jobs:
1224
publish:

0 commit comments

Comments
 (0)