Skip to content

axios versions upgrade #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/gallium
88 changes: 4 additions & 84 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
# Action to manage GitHub deployments

Features:
- create a deployment (and invalidate all previous deployments)
- delete all deployments in specific environment
- delete a deployment by id
# Action to send npm service deployment notifications to Slack

## Usage

### create

Inputs:

| parameter | description
Expand All @@ -23,91 +16,17 @@ Inputs:
`slack_token`|optional token of slack integration to post messages with deployment results
`slack_channel`|optional slack channel name (both `slack_token` and `slack_channel` are required to post a message)

Outputs:

|output | description
|- | -
`deployment_id` | The `id` of the created deployment

#### Example usage

```yaml
- name: create a deployment
uses: npm/action-deploy@v2
- name: send deployment complete message to Slack
uses: npm/action-deployment-notifications@v1
with:
type: create
token: ${{github.token}}
logs: https://your-app.com/deployment_logs
environment: staging
environment_url: https://staging.your-app.com
job_status: ${{job.status}} # use this to track success of the deployment in post script
```

### delete-all

Allows deleting all deployments for a specific environment

Inputs:

|parameter | description
|- | -
`token` | **Required** token to authorize calls to GitHub API, can be ${{github.token}} to create a deployment for the same repo
`type` | **Required** type of an action. Should be `delete-all`
`environment` | environment to delete all deployments in

Outputs: none

#### Example usage

```yaml
- name: delete all deployments in staging
uses: npm/action-deploy@v2
with:
type: delete-all
token: ${{github.token}}
environment: staging
```

### delete

Given in one of the previous steps you created a deployment, with `delete` you can delete it by id

Inputs:

|parameter | description
|- | -
`token` | **Required** token to authorize calls to GitHub API, can be ${{github.token}} to create a deployment for the same repo
`type` | **Required** type of an action. Should be `delete`
`deployment_id` | **Required** the `id` of the a deployment to delete

Outputs: none

#### Example usage

```yaml
- name: create a deployment
uses: npm/action-deploy@v2
id: create-deployment
with:
type: create
token: ${{github.token}}
logs: https://your-app.com/deployment_logs
environment: staging
environment_url: https://staging.your-app.com
job_status: ${{job.status}}

# add your deployment steps here
- name: placeholder for actual deployment
run: sleep 10s

- name: delete deployment
uses: npm/action-deploy@v2
with:
type: delete
token: ${{github.token}}
deployment_id: ${{steps.create-deployment.outputs.deployment_id}}
```

## Development

### Prerequisites
Expand Down Expand Up @@ -163,6 +82,7 @@ Actions are run from GitHub repos so we will checkin the packed dist folder.

Then run [ncc](https://github.com/zeit/ncc) and push the results:
```bash
$ nvm install
$ npm run pack
$ git add dist
$ git commit -a -m "prod dependencies"
Expand Down
36 changes: 4 additions & 32 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,10 @@
name: action-deploy
description: Action to manage GitHub deployments
author: radiantspace
name: action-deployment-notifications
description: Action to send npm service deployment notifications to Slack
author: radiantspace, hashtagchris
inputs:
token:
required: true
description: GitHub token
type:
required: true
description: a type of deployment action to perform, can be 'create', 'delete' and 'delete-all'
logs:
required: false
description: url to deployment logs
description:
required: false
description: description of a deployment
deployment_id:
required: false
description: an id for deployment if 'delete' type is used
status:
required: false
description: status for created deployment
environment:
required: false
description: environment to create or delete all deployments in, default to context.ref without prefixes ('refs/heads/', 'deploy-'), i.e. branch name
environment_url:
required: false
description: link for the deployment (e.g. http://staging.your.app/status)
main_branch:
required: false
description: name of main branch of the repo, to get and store sha of the head commit and track diff being deployed
job_status:
required: false
description: pass `{{job.status}}` to set the deployment completion status post script accordingly
Expand All @@ -41,13 +17,9 @@ inputs:
deployment_confidence_url:
required: false
description: link for the deployment confidence dashboard
mutate_deployment:
required: false
description: Whether the deployment status needs to be mutated by this action
current_sha:
required: false
description: Sha of the deployment
runs:
using: 'node12'
using: 'node16'
main: 'dist/main/index.js'
post: 'dist/post/index.js'
Loading