Skip to content

Commit 7658e18

Browse files
authored
Update npm.yml
1 parent 589a144 commit 7658e18

File tree

1 file changed

+21
-30
lines changed

1 file changed

+21
-30
lines changed

.github/workflows/npm.yml

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,25 @@
1-
on: push
2-
name: Build and Publish
1+
name: npm-publish
2+
on:
3+
push:
4+
branches:
5+
- master # Change this to your default branch
36
jobs:
4-
all:
5-
name: Build and Publish
7+
npm-publish:
8+
name: npm-publish
69
runs-on: ubuntu-latest
710
steps:
8-
- uses: actions/checkout@master
9-
- name: Shell Linter
10-
uses: azohra/shell-linter@v0.3.0
11-
- name: Docker Lint
12-
uses: luke142367/Docker-Lint-Action@v1.0.0
13-
env:
14-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15-
TARGET: Dockerfile
16-
- name: Build Docker
17-
run: docker build -t test .
18-
- name: Cache node_modules
19-
id: cache-modules
20-
uses: actions/cache@v1
11+
- name: Checkout repository
12+
uses: actions/checkout@master
13+
- name: Set up Node.js
14+
uses: actions/setup-node@master
2115
with:
22-
path: node_modules
23-
key: ${{ runner.OS }}-build-${{ hashFiles('package.json') }}
24-
- name: Build
25-
if: steps.cache-modules.outputs.cache-hit != 'true'
26-
run: npm install
27-
- name: Test
28-
run: npm test
29-
- name: Publish
30-
if: github.ref == 'refs/heads/master'
31-
uses: mikeal/merge-release@master
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
16+
node-version: 10.0.0
17+
- name: Publish if version has been updated
18+
uses: pascalgn/npm-publish-action@4f4bf159e299f65d21cd1cbd96fc5d53228036df
19+
with: # All of theses inputs are optional
20+
tag_name: "v%s"
21+
tag_message: "v%s"
22+
commit_pattern: "^Release (\\S+)"
23+
env: # More info about the environment variables in the README
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated
25+
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # You need to set this in your repo settings

0 commit comments

Comments
 (0)