Skip to content

Commit 858501b

Browse files
authored
Add deployment notifications (#40)
1 parent 1c668ac commit 858501b

File tree

4 files changed

+36
-7
lines changed

4 files changed

+36
-7
lines changed

.github/workflows/publish.yml

+32-3
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,26 @@ name: Publish
33
on:
44
release:
55
types: [created]
6-
76
jobs:
87
build:
98
runs-on: ubuntu-latest
9+
env:
10+
TARGET_URL: https://www.npmjs.com/package/@patch-technology/patch
11+
1012
steps:
11-
- uses: actions/checkout@v1
13+
- uses: actions/checkout@v2
14+
15+
- uses: chrnorm/deployment-action@releases/v1
16+
name: Create GitHub deployment
17+
id: deployment
18+
with:
19+
token: "${{ github.token }}"
20+
target_url: ${{ env.TARGET_URL }}
21+
environment: production
22+
1223
- uses: actions/setup-node@v2
1324
with:
14-
node-version: 12
25+
node-version: 14
1526
registry-url: https://registry.npmjs.org/
1627

1728
- name: Install dependencies
@@ -29,3 +40,21 @@ jobs:
2940
run: npm publish --access public
3041
env:
3142
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
43+
44+
- name: Update deployment status (success)
45+
if: success()
46+
uses: chrnorm/deployment-status@releases/v1
47+
with:
48+
token: "${{ github.token }}"
49+
target_url: ${{ env.TARGET_URL }}
50+
state: "success"
51+
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
52+
53+
- name: Update deployment status (failure)
54+
if: failure()
55+
uses: chrnorm/deployment-status@releases/v1
56+
with:
57+
token: "${{ github.token }}"
58+
target_url: ${{ env.TARGET_URL }}
59+
state: "failure"
60+
deployment_id: ${{ steps.deployment.outputs.deployment_id }}

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@patch-technology/patch",
3-
"version": "1.10.1",
3+
"version": "1.10.2",
44
"description": "Node.js wrapper for the Patch API",
55
"license": "MIT",
66
"repository": {

src/ApiClient.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ApiClient {
1616
};
1717

1818
this.defaultHeaders = {
19-
'User-Agent': 'patch-node/1.10.1'
19+
'User-Agent': 'patch-node/1.10.2'
2020
};
2121

2222
/**

0 commit comments

Comments
 (0)