-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
160 lines (150 loc) · 4.92 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: 'Install ImpressCMS'
description: 'GitHub action to install ImpressCMS'
# https://actions-cool.github.io/github-action-branding/
branding:
icon: cpu
color: 'yellow'
inputs:
url:
description: "Site URL"
default: http://localhost
required: false
database_type:
description: "Database type"
default: pdo.mysql
required: false
database_host:
description: "Database host"
default: 127.0.0.1
required: false
database_user:
description: "Database user"
required: true
database_password:
description: "Database password"
default: ""
required: false
database_name:
description: "Database name"
default: icms
required: false
database_charset:
description: "Charset used for database"
default: utf8
required: false
database_collation:
description: "Collation used for database"
default: utf8_general_ci
required: false
database_prefix:
description: "Prefix for each ImpressCMS database table"
default: icms_${{ github.run_id }}_${{ github.run_attempt }}
required: false
database_port:
description: "Port that is used for database connection"
default: "3306"
required: false
admin_name:
description: "Administrator name"
default: icms
required: false
admin_login:
description: "Administrator login string"
default: icms
required: false
admin_pass:
description: "Administrator password"
default: icms
required: false
admin_email:
description: "Administrator email"
default: [email protected]
required: false
language:
description: "Installation language"
default: english
required: false
app_key:
description: "Application key. If not specified and your ImpressCMS version supports it, it will be generated automatically"
default: ""
required: false
path:
description: "Where ImpressCMS is located?"
default: "."
required: false
outputs:
app_key:
description: Generated application key
value: ${{ steps.checks2.outputs.app_key }}
uses_composer:
description: Returns if current ImpressCMS version uses Composer for package management
value: ${{ steps.checks1.outputs.uses_composer }}
uses_phoenix:
description: Returns if current ImpressCMS version uses Phoenix for migrations
value: ${{ steps.checks2.outputs.uses_phoenix }}
runs:
using: 'composite'
steps:
- name: Doing some nessary checks (part I)
id: checks1
run: |
bash ${{ github.action_path }}/bin/uses-composer.sh
shell: bash
working-directory: ${{ inputs.path }}
- name: Failing because of no composer support
run: |
echo 'ERROR: Currently only ImpressCMS versions that has composer support are supported for this action'
exit 1
shell: bash
if: steps.checks1.outputs.uses_composer == 'false'
- name: Install Composer dependencies (with dev)
run: composer install --no-progress --prefer-dist --optimize-autoloader
shell: bash
working-directory: ${{ inputs.path }}
- name: Doing some nessary checks (part II)
id: checks2
run: |
bash ${{ github.action_path }}/bin/app-key.sh "${{ inputs.app_key }}"
bash ${{ github.action_path }}/bin/uses-phoenix.sh
shell: bash
working-directory: ${{ inputs.path }}
- name: Failing because of no phoenix support
run: |
echo 'ERROR: Currently only ImpressCMS versions that has phoenix support are supported for this action'
exit 1
shell: bash
if: steps.checks1.outputs.uses_phoenix == 'false'
- name: Chmoding folders...
run: |
chmod -R 0777 ./storage || true
chmod -R 0777 ./modules || true
chmod -R 0777 ./themes || true
chmod -R 0777 ./uploads || true
chmod -R 0777 ./htdocs/modules || true
chmod -R 0777 ./htdocs/themes || true
chmod -R 0777 ./htdocs/uploads || true
chmod -R 0777 ./htdocs/images || true
shell: bash
working-directory: ${{ inputs.path }}
- name: Installing ImpressCMS
env:
URL: ${{ inputs.url }}
DB_TYPE: ${{ inputs.database_type }}
DB_HOST: ${{ inputs.database_host }}
DB_USER: ${{ inputs.database_user }}
DB_PASS: ${{ inputs.database_password }}
DB_PCONNECT: "0"
DB_NAME: ${{ inputs.database_name }}
DB_CHARSET: ${{ inputs.database_charset }}
DB_COLLATION: ${{ inputs.database_collation }}
DB_PREFIX: ${{ inputs.database_prefix }}
DB_PORT: ${{ inputs.database_port }}
INSTALL_ADMIN_PASS: ${{ inputs.admin_name }}
INSTALL_ADMIN_LOGIN: ${{ inputs.admin_login }}
INSTALL_ADMIN_NAME: ${{ inputs.admin_pass }}
INSTALL_ADMIN_EMAIL: ${{ inputs.admin_email }}
INSTALL_LANGUAGE: ${{ inputs.language }}
APP_KEY: ${{ steps.checks2.outputs.app_key }}
run: ./bin/phoenix migrate -vvv
shell: bash
working-directory: ${{ inputs.path }}