-
Notifications
You must be signed in to change notification settings - Fork 15
/
action.yml
126 lines (124 loc) · 4.21 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: "Preview Environments for GitHub"
description: "Ephemeral preview deployments of your app for every pull request. Just using Docker Compose. In your AWS account."
author: "Cyril Rohr"
branding:
icon: anchor
color: purple
inputs:
app_path:
description: "The path to your application containing a docker-compose file"
default: "/github/workspace"
required: false
always_on:
description: "List of always-on branches, irrespective of whether they correspond to an open Pull Request, comma-separated"
default: ""
dns:
description: "Which DNS suffix to use"
default: "my.preview.run"
max_domain_length:
description: "Maximum length of fully qualified domain name. Note that it cannot be greater than 62 characters due to LetsEncrypt restrictions."
default: "62"
label:
description: "Label to use for triggering preview deployments"
default: "pullpreview"
github_token:
description: "The GitHub access token used to perform GitHub API operations. A custom token is only required for auto-cleanup of GitHub environment objects."
default: "${{ github.token }}"
admins:
description: "Logins of GitHub users that will have their SSH key installed on the instance, comma-separated"
required: false
default: "@collaborators/push"
ports:
description: "Ports to open for external access on the preview server (port 22 is always open), comma-separated"
required: false
default: "80/tcp,443/tcp"
cidrs:
description: "The IP address, or range of IP addresses in CIDR notation, that are allowed to connect to the instance"
required: false
default: "0.0.0.0/0"
default_port:
description: "The port to use when building the preview URL"
required: false
default: "80"
compose_files:
description: "Compose files to use when running docker-compose up, comma-separated"
required: false
default: "docker-compose.yml"
compose_options:
description: "Additional options to pass to docker-compose up, comma-separated"
required: false
default: "--build"
license:
description: "PullPreview license"
required: false
default: ""
instance_type:
description: "Instance type to use"
required: false
default: "small"
deployment_variant:
description: "Deployment variant, which allows launching multiple deployments per PR (4 chars max)"
required: false
default: ""
provider:
description: "Cloud provider to use: lightsail"
required: false
default: "lightsail"
registries:
description: "Names of private registries to authenticate against. E.g. docker://username:[email protected]"
required: false
default: ""
pre_script:
description: "Path to a bash script to run on the instance, before calling docker compose, relative to the app_path"
required: false
default: ""
ttl:
description: "Maximum time to live for deployments (e.g. 10h, 5d, infinite)"
required: false
default: "infinite"
outputs:
url:
description: "The URL of the application on the preview server"
host:
description: "The hostname or IP address of the preview server"
username:
description: "The username that can be used to SSH into the preview server"
runs:
using: "docker"
image: "Dockerfile"
args:
- "github-sync"
- "${{ inputs.app_path }}"
- "--admins"
- "${{ inputs.admins }}"
- "--cidrs"
- "${{ inputs.cidrs }}"
- "--compose-files"
- "${{ inputs.compose_files }}"
- "--compose-options"
- "${{ inputs.compose_options }}"
- "--dns"
- "${{ inputs.dns }}"
- "--label"
- "${{ inputs.label }}"
- "--ports"
- "${{ inputs.ports }}"
- "--default-port"
- "${{ inputs.default_port }}"
- "--always-on"
- "${{ inputs.always_on }}"
- "--instance-type"
- "${{ inputs.instance_type }}"
- "--deployment-variant"
- "${{ inputs.deployment_variant }}"
- "--registries"
- "${{ inputs.registries }}"
- "--pre-script"
- "${{ inputs.pre_script }}"
- "--ttl"
- "${{ inputs.ttl }}"
env:
GITHUB_TOKEN: "${{ inputs.github_token }}"
PULLPREVIEW_LICENSE: "${{ inputs.license }}"
PULLPREVIEW_PROVIDER: "${{ inputs.provider }}"
PULLPREVIEW_MAX_DOMAIN_LENGTH: "${{ inputs.max_domain_length }}"