Skip to content

Commit

Permalink
Added Trigger-deploy Github action (#1)
Browse files Browse the repository at this point in the history
✨ initial commit
  • Loading branch information
sumitkolhe authored Feb 19, 2021
1 parent 7526c9b commit 0bd0099
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 0 deletions.
Binary file modified README.md
Binary file not shown.
4 changes: 4 additions & 0 deletions trigger-deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM kintohub/kinto-cli:latest
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
41 changes: 41 additions & 0 deletions trigger-deploy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Trigger Deploy

Github action for KintoHub for CI/CD. `Trigger Deploy` uses [Kinto-CLI](https://github.com/kintoproj/kinto-cli) underneath to trigger deploys for any given service.

## Usage

### Parameters


| parameter | description | required |
| --------- | --------------------------------- | -------- |
| core_host | The host address of your KintoHub instance. Should be supplied in the format `Host:Port` | true |
| environment_id | Environment Id of the service that you want CI/CD functionality for. | true |
| service_name | Name of the service that you want CI/CD for. | true |



To use this action for CI/CD functionality, create a `Github Workflow` in the github repo of your service.

### Example Github Workflow :

> .github/workflows/trigger-deploy.yml
```yaml
name: Trigger Deploy
on:
push:
branches : [ main ]
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- name: trigger deploy
uses: kintoproj/kinto-github-actions/[email protected]
with:
core_host: core.oss.kintohub.net:443
environment_id: 600f12ceb32a91c8d7b3f72d
service_name: nodejs

```

22 changes: 22 additions & 0 deletions trigger-deploy/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: kinto-github-actions
description: Trigger deploy a service inside an environment for a KintoHub instance.
author: sumitkolhe
branding:
icon: upload-cloud
color: blue
inputs:
core_host:
description: Core Host for the KintoHub instance.
required: true
environment_id:
description: Environment id of the desired service.
required: true
service_name:
description: Name of the service that needs to be trigger deployed.
required: true


runs:
using: 'docker'
image: 'Dockerfile'

5 changes: 5 additions & 0 deletions trigger-deploy/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
set -e

kinto init $INPUT_CORE_HOST
kinto deploy $INPUT_ENVIRONMENT_ID $INPUT_SERVICE_NAME

0 comments on commit 0bd0099

Please sign in to comment.