-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
74 lines (73 loc) · 3.36 KB
/
action.yml
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
name: Deploy Docker to Compose Host
description: Github action, designed to deploy built docker-images onto a prepared host server through SSH.
inputs:
ssh-host:
description: 'The SSH host to deploy to.'
required: true
ssh-user:
description: 'The SSH user to connect to on the host'
default: 'deployment'
ssh-port:
description: 'The SSH port on the host to connect to'
default: '22'
ssh-fingerprint:
description: 'The Fingerprint of the SSH server should you not be able to connect to the host'
ssh-key:
description: 'The BASE64 encoded private key to use when connecting to the server'
ssh-use-cloudflared:
description: 'If set to true, the connection will be tunneled through cloudflared'
default: 'false'
docker-dir:
description: 'The directory on the host machine where to put the project folder'
default: '/02_docker'
login-script:
description: 'The script to refresh the docker-login before deployment'
default: '/opt/docker-login.sh'
project-env:
description: 'Useful for staging and prod variants on the same host'
default: 'prod'
project-name:
description: 'The name of the project folder to create below the docker-dir'
default: '${GITHUB_REPOSITORY}/${project-env}'
additional-files:
description: 'A comma separated list of files that should be transferred to the host server'
before-script:
description: 'A shell script to execute on the host machine before the deployment takes place'
before-login-script:
description: 'A shell script to execute on the host machine before the docker login takes place'
before-pull-script:
description: 'A shell script to execute on the host machine before the new image is pulled'
after-pull-script:
description: 'A shell script to execute on the host machine after the new image was pulled'
after-script:
description: 'A shell script to execute on the host machine after the deployment took place'
archive-name:
description: 'Name of the transfer archive'
default: '${GITHUB_SHA}.${GITHUB_RUN_ID}.zip'
server-env-file:
description: '(The absolute path to an .env file on the server which will be appended to the generated .env file'
docker-compose-options:
description: 'Additional docker-compose arguments to use when booting the container'
runs:
using: 'docker'
image: 'Dockerfile'
env:
DEPLOY_SSH_HOST: ${{ inputs.ssh-host }}
DEPLOY_DOCKER_DIR: ${{ inputs.docker-dir }}
DEPLOY_DOCKER_LOGIN_SCRIPT: ${{ inputs.login-script }}
DEPLOY_PROJECT_ENV: ${{ inputs.project-env }}
DEPLOY_PROJECT_NAME: ${{ inputs.project-name }}
DEPLOY_SSH_USER: ${{ inputs.ssh-user }}
DEPLOY_SSH_PORT: ${{ inputs.ssh-port }}
DEPLOY_SSH_FINGERPRINT: ${{ inputs.ssh-fingerprint }}
DEPLOY_SSH_KEY: ${{ inputs.ssh-key }}
DEPLOY_SSH_USE_CLOUDFLARED: ${{ inputs.ssh-use-cloudflared }}
DEPLOY_ADDITIONAL_FILES: ${{ inputs.additional-files }}
DEPLOY_ARCHIVE_NAME: ${{ inputs.archive-name }}
DEPLOY_SERVER_ENV_FILE: ${{ inputs.server-env-file }}
DEPLOY_DOCKER_COMPOSE_OPTIONS: ${{ inputs.docker-compose-options }}
DEPLOY_BEFORE_SCRIPT: ${{ inputs.before-script }}
DEPLOY_BEFORE_LOGIN_SCRIPT: ${{ inputs.before-login-script }}
DEPLOY_BEFORE_PULL_SCRIPT: ${{ inputs.before-pull-script }}
DEPLOY_AFTER_PULL_SCRIPT: ${{ inputs.after-pull-script }}
DEPLOY_AFTER_SCRIPT: ${{ inputs.after-script }}