Skip to content

Commit 4ae93d3

Browse files
authored
Update README.md with more documentation
1 parent 92b9b1e commit 4ae93d3

1 file changed

Lines changed: 59 additions & 5 deletions

File tree

README.md

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# EvenNode Deploy Action
22

3-
GitHub Action for seamless deployment to EvenNode platforms.
3+
GitHub Action for seamless deployment to [EvenNode](https://www.evennode.com) platforms.
4+
5+
> [!NOTE]
6+
> This action requires an `EvenNode repository URL` and `SSH key` authorization.
7+
>
8+
> If you're not familiar with these, please refer to the documentation about deploying an EvenNode application and generating an SSH key for upload:
9+
> https://www.evennode.com/docs/git-deployment
410
511
## Features
612

@@ -10,9 +16,8 @@ GitHub Action for seamless deployment to EvenNode platforms.
1016
- Flexible branch targeting
1117
- Force push control
1218

13-
## Usage
19+
## Basic Usage
1420

15-
This is a basic usage:
1621
```yaml
1722
name: Deploy to EvenNode
1823

@@ -36,6 +41,34 @@ jobs:
3641
dot_env: ${{ secrets.DOT_ENV }}
3742
```
3843
44+
## Recommended Usage
45+
46+
```yaml
47+
name: Deploy to EvenNode
48+
49+
on:
50+
push:
51+
branches: [ main ]
52+
53+
jobs:
54+
deploy:
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v4
58+
59+
- name: Deploy to EvenNode
60+
uses: your-username/evennode-deploy-action@v1
61+
with:
62+
key: ${{ secrets.EVENNODE_SSH_KEY }}
63+
git_email: ${{ secrets.GIT_EMAIL }}
64+
git_name: ${{ secrets.GIT_NAME }}
65+
git_url: ${{ secrets.EVENNODE_GIT_URL }}
66+
dot_env: ${{ secrets.DOT_ENV }}
67+
```
68+
69+
**Why use secrets for credentials?**
70+
- Allows different team members to use their own credentials
71+
- Enables easy rotation of credentials without code changes
3972
4073
## Inputs
4174
@@ -48,6 +81,27 @@ jobs:
4881
| `dot_env` | No | Content for .env file |
4982
| `commit_message` | No | Custom commit message |
5083
| `branch` | No | Target branch (default: main) |
51-
| `pre_commit_command` | No | Command to run before commit |
84+
| `pre_commit_command` | No | Command to run before commit (e.g. build commands or adding build artifacts) |
5285
| `pre_push_command` | No | Command to run before push |
53-
| `force_push` | No | Force push (default: true) |
86+
| `force_push` | No | Force push (default: true) |
87+
88+
## About pre_commit_command
89+
90+
The `pre_commit_command` input allows you to execute custom commands before the deployment commit is created. This is particularly useful for:
91+
92+
1. Building your application and including the build artifacts in the commit
93+
2. Running tests or validations before deployment
94+
3. Preparing any necessary files or directories
95+
96+
A example use case is building a Next.js application and including the `.next` folder in the commit to avoid recompilation on the EvenNode host. Here's an example from a real implementation:
97+
98+
```yaml
99+
pre_commit_command: |
100+
npm install
101+
npm run build
102+
git add .next
103+
```
104+
105+
You can see this in action in [this workflow.](https://github.com/rodnye/inf-cujae-website/blob/8c56335a5fba293824efecab8737e5808814871c/.github/workflows/evennode.yml#L43)
106+
107+
This approach significantly reduces deployment time as the host doesn't need to rebuild the application. The built files are included directly in the deployment.

0 commit comments

Comments
 (0)