You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+59-5Lines changed: 59 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,12 @@
1
1
# EvenNode Deploy Action
2
2
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
4
10
5
11
## Features
6
12
@@ -10,9 +16,8 @@ GitHub Action for seamless deployment to EvenNode platforms.
10
16
- Flexible branch targeting
11
17
- Force push control
12
18
13
-
## Usage
19
+
## Basic Usage
14
20
15
-
This is a basic usage:
16
21
```yaml
17
22
name: Deploy to EvenNode
18
23
@@ -36,6 +41,34 @@ jobs:
36
41
dot_env: ${{ secrets.DOT_ENV }}
37
42
```
38
43
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
39
72
40
73
## Inputs
41
74
@@ -48,6 +81,27 @@ jobs:
48
81
| `dot_env` | No | Content for .env file |
49
82
| `commit_message` | No | Custom commit message |
50
83
| `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) |
52
85
| `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