1
- # Action to manage GitHub deployments
2
-
3
- Features:
4
- - create a deployment (and invalidate all previous deployments)
5
- - delete all deployments in specific environment
6
- - delete a deployment by id
1
+ # Action to send npm service deployment notifications to Slack
7
2
8
3
## Usage
9
4
10
- ### create
11
-
12
5
Inputs:
13
6
14
7
| parameter | description
@@ -23,91 +16,17 @@ Inputs:
23
16
` slack_token ` |optional token of slack integration to post messages with deployment results
24
17
` slack_channel ` |optional slack channel name (both ` slack_token ` and ` slack_channel ` are required to post a message)
25
18
26
- Outputs:
27
-
28
- |output | description
29
- |- | -
30
- ` deployment_id ` | The ` id ` of the created deployment
31
-
32
19
#### Example usage
33
20
34
21
``` yaml
35
- - name : create a deployment
36
- uses : npm/action-deploy@v2
22
+ - name : send deployment complete message to Slack
23
+ uses : npm/action-deployment-notifications@v1
37
24
with :
38
- type : create
39
- token : ${{github.token}}
40
- logs : https://your-app.com/deployment_logs
41
25
environment : staging
42
26
environment_url : https://staging.your-app.com
43
27
job_status : ${{job.status}} # use this to track success of the deployment in post script
44
28
` ` `
45
29
46
- ### delete-all
47
-
48
- Allows deleting all deployments for a specific environment
49
-
50
- Inputs:
51
-
52
- |parameter | description
53
- |- | -
54
- ` token` | **Required** token to authorize calls to GitHub API, can be ${{github.token}} to create a deployment for the same repo
55
- ` type` | **Required** type of an action. Should be `delete-all`
56
- ` environment` | environment to delete all deployments in
57
-
58
- Outputs : none
59
-
60
- # ### Example usage
61
-
62
- ` ` ` yaml
63
- - name: delete all deployments in staging
64
- uses: npm/action-deploy@v2
65
- with:
66
- type: delete-all
67
- token: ${{github.token}}
68
- environment: staging
69
- ` ` `
70
-
71
- # ## delete
72
-
73
- Given in one of the previous steps you created a deployment, with `delete` you can delete it by id
74
-
75
- Inputs :
76
-
77
- |parameter | description
78
- |- | -
79
- ` token` | **Required** token to authorize calls to GitHub API, can be ${{github.token}} to create a deployment for the same repo
80
- ` type` | **Required** type of an action. Should be `delete`
81
- ` deployment_id` | **Required** the `id` of the a deployment to delete
82
-
83
- Outputs : none
84
-
85
- # ### Example usage
86
-
87
- ` ` ` yaml
88
- - name: create a deployment
89
- uses: npm/action-deploy@v2
90
- id: create-deployment
91
- with:
92
- type: create
93
- token: ${{github.token}}
94
- logs: https://your-app.com/deployment_logs
95
- environment: staging
96
- environment_url: https://staging.your-app.com
97
- job_status: ${{job.status}}
98
-
99
- # add your deployment steps here
100
- - name: placeholder for actual deployment
101
- run: sleep 10s
102
-
103
- - name: delete deployment
104
- uses: npm/action-deploy@v2
105
- with:
106
- type: delete
107
- token: ${{github.token}}
108
- deployment_id: ${{steps.create-deployment.outputs.deployment_id}}
109
- ` ` `
110
-
111
30
## Development
112
31
113
32
### Prerequisites
@@ -163,6 +82,7 @@ Actions are run from GitHub repos so we will checkin the packed dist folder.
163
82
164
83
Then run [ ncc] ( https://github.com/zeit/ncc ) and push the results:
165
84
``` bash
85
+ $ nvm install
166
86
$ npm run pack
167
87
$ git add dist
168
88
$ git commit -a -m " prod dependencies"
0 commit comments