Skip to content

Commit

Permalink
feat: 🎸 first version
Browse files Browse the repository at this point in the history
  • Loading branch information
ttskch committed Aug 21, 2023
1 parent ddcdf11 commit e4235dd
Show file tree
Hide file tree
Showing 16 changed files with 4,945 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
node_modules/
22 changes: 22 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": [
// https://github.com/eslint/eslint/blob/main/packages/js/src/configs/eslint-recommended.js
"eslint:recommended",
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended.ts
"plugin:@typescript-eslint/recommended",
// https://github.com/prettier/eslint-config-prettier/blob/main/index.js
"prettier"
],
"plugins": ["import"],
"rules": {
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
"import/order": [
"error",
{
"alphabetize": {
"order": "asc"
}
}
]
}
}
58 changes: 58 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI

on:
push:
pull_request:

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [16]
pnpm: [8]

steps:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
check-latest: true

- uses: pnpm/action-setup@v2
with:
version: ${{ matrix.pnpm }}

- uses: actions/checkout@v3

- name: Get pnpm store directory path
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Cache pnpm dependencies
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- run: pnpm i

- run: pnpm all

# @see https://github.com/actions/typescript-action/blob/a08de7557cbd661c684b5179f7e12277025ff914/.github/workflows/check-dist.yml
- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
id: diff
# If index.js was different from expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": false,
"trailingComma": "all",
"bracketSpacing": false,
"singleQuote": true
}
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
# render-deploy
# Render Deploy

[![CI](https://github.com/ttskch/render-deploy/actions/workflows/ci.yaml/badge.svg)](https://github.com/ttskch/render-deploy/actions/workflows/ci.yaml)

The most simple and customizable GitHub Action to deploy a service to [Render.com](https://render.com/).

## Inputs

| Name | Description | Required | Default |
| --- | --- | --- | --- |
| `api-key` | Render.com API key | Yes | |
| `service-id` | ID of the service to deploy | Yes | |
| `interval` | Interval to check deploy status (sec) | | 10 |
| `timeout` | If deploy has not finished after this time, the action will fail (sec) | | 600 |

## Example usage

```yaml
name: Render Deploy

on:
push:
pull_request:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: ttskch/[email protected]
with:
api-key: ${{ secrets.RENDER_API_KEY }}
service-id: ${{ secrets.RENDER_SERVICE_ID }}
interval: 20 # optional
timeout: 300 # optional
```
24 changes: 24 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Render.com Deploy
description: The most simple and customizable GitHub Action to deploy a service to Render.com.
author: Takashi Kanemoto
branding:
icon: upload-cloud
color: green
inputs:
api-key:
description: Render.com API key
required: true
service-id:
description: ID of the service to deploy
required: true
interval:
description: Interval to check deploy status (sec)
required: false
default: "10"
timeout:
description: If deploy has not finished after this time, the action will fail (sec)
required: false
default: "600"
runs:
using: node16
main: dist/index.js
Loading

0 comments on commit e4235dd

Please sign in to comment.