-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
77 lines (76 loc) · 2.32 KB
/
Copy pathaction.yml
File metadata and controls
77 lines (76 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# action.yml
name: 'Do-Nginx-App'
description: 'Initialize your Node app with Nginx HTTP Proxy'
inputs:
host:
description: 'The IP address of your server'
required: true
protocol:
description: 'SSH connection protocol. Default is set to "tcp".'
required: false
default: 'tcp'
port:
description: 'The port for host connection. Default is set to -> 22.'
required: false
default: '22'
user:
description: 'Virtual machine user'
required: true
password:
description: 'Password to authenticate ssh connection'
required: false
key:
description: 'Authorized SSH key to authenticate ssh connection'
required: false
passphrase:
description: 'Associated passphrase if any, to the provided authorized SSH key'
required: false
github-repo:
description: 'The github repository with the server code your trying to run.'
required: true
startup-script:
description: 'Script to run your app. e.g npm start'
required: true
api-port:
description: 'Configured PORT. e.g 5000'
required: true
env:
description: 'Environmental variables. Key-value pairs -> KEY=VALUE'
required: false
outputs:
time:
description: 'Timestamp of action execution'
value: ${{ steps.timestamp.outputs.time }}
deployment-status:
description: 'Whether the deployment was successful'
value: ${{ steps.deployment.outputs.status }}
runs:
using: 'composite'
steps:
- name: Set Timestamp
id: timestamp
shell: bash
run: echo "time=$(date)" >> "$GITHUB_OUTPUT"
- name: Prepare Do Nginx Client
id: deployment
shell: bash
env:
INPUT_HOST: ${{ inputs.host }}
INPUT_PROTOCOL: ${{ inputs.protocol }}
INPUT_PORT: ${{ inputs.port }}
INPUT_USER: ${{ inputs.user }}
INPUT_PASSWORD: ${{ inputs.password }}
INPUT_PKEY: ${{ inputs.key }}
INPUT_PASSPHRASE: ${{ inputs.passphrase }}
INPUT_GITHUB_REPO: ${{ inputs.github-repo }}
INPUT_STARTUP_SCRIPT: ${{ inputs.startup-script }}
INPUT_API_PORT: ${{ inputs.api-port }}
INPUT_ENV: ${{ inputs.env }}
run: |
chmod +x ${{ github.action_path }}/entrypoint.sh
bash ${{ github.action_path }}/entrypoint.sh
if [ $? -eq 0 ]; then
echo "status=success" >> "$GITHUB_OUTPUT"
else
echo "status=failure" >> "$GITHUB_OUTPUT"
fi