forked from concretecms/concretecms
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (67 loc) · 2.29 KB
/
install.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
name: Install
on:
pull_request:
push:
jobs:
install:
name: Install ${{ matrix.starting-point }} with PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
container: ghcr.io/concrete5-community/docker5:base
strategy:
matrix:
php-version:
- "7.4"
- "8.2"
starting-point:
- atomik_full
steps:
-
name: Configure environment
run: |
switch-composer 2
switch-php ${{ matrix.php-version }}
ccm-service start db
-
name: Checkout
uses: actions/checkout@v3
-
name: Set owner
run: chown -R www-data:www-data "$GITHUB_WORKSPACE"
-
name: Install Composer dependencies
run: sudo -Hu www-data composer install --optimize-autoloader --no-cache --ansi --no-interaction
-
name: Configure Concrete
run: |
sudo -Hu www-data ./concrete/bin/concrete5 c5:config -g -- set concrete.debug.display_errors true
sudo -Hu www-data ./concrete/bin/concrete5 c5:config -g -- set concrete.debug.detail debug
sudo -Hu www-data ./concrete/bin/concrete5 c5:config -g -- set concrete.debug.error_reporting -1
-
name: Install
run: |
sudo -Hu www-data \
./concrete/bin/concrete5 c5:install \
--ansi --no-interaction \
--db-server=localhost \
--db-username=c5 \
--db-password=12345 \
--db-database=c5 \
--timezone=UTC \
--site='ConcreteCMS website' \
--starting-point=${{ matrix.starting-point }} \
--admin-email=admin@example.org \
--admin-password=12345 \
-vvv
-
name: Test that the website actually works
run: |
rm -rf /app
ln -s "$GITHUB_WORKSPACE" /app
ccm-service start web
SITE_NAME="$(sudo -u www-data ./concrete/bin/concrete5 c5:config get site.sites.default.name)"
curl -sSi -o /tmp/index.html http://localhost/
if ! head -n1 /tmp/index.html | grep -Eq '^HTTP[^\s]* 200 ' || ! grep -Eq "<title>.*$SITE_NAME.*</title>" /tmp/index.html; then
echo 'Wrong response from the website' >&1
cat /tmp/index.html >&2
exit 1
fi