1+ name : ' Install ImpressCMS'
2+ description : ' GitHub action to install ImpressCMS'
3+
4+ # https://actions-cool.github.io/github-action-branding/
5+ branding :
6+ icon : cpu
7+ color : ' yellow'
8+
9+ inputs :
10+ url :
11+ description : " Site URL"
12+ default : http://localhost
13+ required : false
14+ database_type :
15+ description : " Database type"
16+ default : pdo.mysql
17+ required : false
18+ database_host :
19+ description : " Database host"
20+ default : 127.0.0.1
21+ required : false
22+ database_user :
23+ description : " Database user"
24+ required : true
25+ database_password :
26+ description : " Database password"
27+ default : " "
28+ required : false
29+ database_name :
30+ description : " Database name"
31+ default : icms
32+ required : false
33+ database_charset :
34+ description : " Charset used for database"
35+ default : utf8
36+ required : false
37+ database_collation :
38+ description : " Collation used for database"
39+ default : utf8_general_ci
40+ required : false
41+ database_prefix :
42+ description : " Prefix for each ImpressCMS database table"
43+ default : icms_${{ github.run_id }}_${{ github.run_attempt }}
44+ required : false
45+ database_port :
46+ description : " Port that is used for database connection"
47+ default : " 3306"
48+ required : false
49+ admin_name :
50+ description : " Administrator name"
51+ default : icms
52+ required : false
53+ admin_login :
54+ description : " Administrator login string"
55+ default : icms
56+ required : false
57+ admin_pass :
58+ description : " Administrator password"
59+ default : icms
60+ required : false
61+ admin_email :
62+ description : " Administrator email"
63+ default : noreply@impresscms.dev
64+ required : false
65+ language :
66+ description : " Installation language"
67+ default : english
68+ required : false
69+ app_key :
70+ description : " Application key. If not specified and your ImpressCMS version supports it, it will be generated automatically"
71+ default : " "
72+ required : false
73+
74+ outputs :
75+ app_key :
76+ description : Generated application key
77+ value : ${{ steps.checks2.outputs.app_key }}
78+ uses_composer :
79+ description : Returns if current ImpressCMS version uses Composer for package management
80+ value : ${{ steps.checks1.outputs.uses_composer }}
81+ uses_phoenix :
82+ description : Returns if current ImpressCMS version uses Phoenix for migrations
83+ value : ${{ steps.checks2.outputs.uses_phoenix }}
84+
85+ runs :
86+ using : ' composite'
87+ steps :
88+ - name : Doing some nessary checks (part I)
89+ id : checks1
90+ run : |
91+ bash ${{ github.action_path }}/bin/uses-composer.sh
92+ shell : bash
93+
94+ - name : Failing because of no composer support
95+ run : |
96+ echo 'ERROR: Currently only ImpressCMS versions that has composer support are supported for this action'
97+ exit 1
98+ shell : bash
99+ if : steps.checks1.outputs.uses_composer == 'false'
100+
101+ - name : Install Composer dependencies (with dev)
102+ run : composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
103+ shell : bash
104+
105+ - name : Doing some nessary checks (part II)
106+ id : checks2
107+ run : |
108+ bash ${{ github.action_path }}/bin/app-key.sh "${{ inputs.app_key }}"
109+ bash ${{ github.action_path }}/bin/uses-phoenix.sh
110+ shell : bash
111+
112+ - name : Failing because of no phoenix support
113+ run : |
114+ echo 'ERROR: Currently only ImpressCMS versions that has phoenix support are supported for this action'
115+ exit 1
116+ shell : bash
117+ if : steps.checks1.outputs.uses_phoenix == 'false'
118+
119+ - name : Chmoding folders...
120+ run : chmod -R 0777 ./storage ./modules ./themes ./uploads
121+ shell : bash
122+
123+ - name : Installing ImpressCMS
124+ env :
125+ URL : ${{ inputs.url }}
126+ DB_TYPE : ${{ inputs.database_type }}
127+ DB_HOST : ${{ inputs.database_host }}
128+ DB_USER : ${{ inputs.database_user }}
129+ DB_PASS : ${{ inputs.database_password }}
130+ DB_PCONNECT : " 0"
131+ DB_NAME : ${{ inputs.database_name }}
132+ DB_CHARSET : ${{ inputs.database_charset }}
133+ DB_COLLATION : ${{ inputs.database_collation }}
134+ DB_PREFIX : ${{ inputs.database_prefix }}
135+ DB_PORT : ${{ inputs.database_port }}
136+ INSTALL_ADMIN_PASS : ${{ inputs.admin_name }}
137+ INSTALL_ADMIN_LOGIN : ${{ inputs.admin_login }}
138+ INSTALL_ADMIN_NAME : ${{ inputs.admin_pass }}
139+ INSTALL_ADMIN_EMAIL : ${{ inputs.admin_email }}
140+ INSTALL_LANGUAGE : ${{ inputs.language }}
141+ APP_KEY : ${{ steps.checks2.outputs.app_key }}
142+ run : ./bin/phoenix migrate -vvv
143+ shell : bash
0 commit comments