-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (69 loc) · 2.71 KB
/
build.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: Test and confirm functional build
on:
workflow_dispatch:
push:
jobs:
setup_lamp_environment:
runs-on: ubuntu-latest
env:
path_to_site_codebase_on_runner: ${{ github.workspace }} # Base path where repo is cloned
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: drupal
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up PHP 8.2
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
extensions: mbstring, curl, zip
coverage: none
- name: Setup Apache
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y apache2 libapache2-mod-php8.2 php8.2-mysql
sudo sed -i 's#/var/www/html#${{ env.path_to_site_codebase_on_runner }}/web#g' /etc/apache2/sites-available/000-default.conf
sudo sed -i 's#/var/www/html#${{ env.path_to_site_codebase_on_runner }}/web#g' /etc/apache2/sites-available/default-ssl.conf
sudo systemctl restart apache2
- name: Create settings.local.php
run: |
cat <<EOF > ${{ env.path_to_site_codebase_on_runner }}/web/sites/default/settings.local.php
<?php
\$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => 'drupal',
'username' => 'root',
'password' => 'root',
'host' => '127.0.0.1',
'port' => '3306',
'prefix' => '',
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
'driver' => 'mysql',
);
EOF
chmod 755 ${{ env.path_to_site_codebase_on_runner }}/web/sites/default/settings.local.php
- name: Install Composer Dependencies
run: |
cd ${{ env.path_to_site_codebase_on_runner }}
composer install --no-progress --no-interaction
- name: Initialize Drupal Installation
run: |
cd ${{ env.path_to_site_codebase_on_runner }}
./vendor/bin/drush si -y
./vendor/bin/drush en aqto_defaults -y
./vendor/bin/drush cr
./vendor/bin/drush uli
sudo chown -R www-data:www-data ${{ env.path_to_site_codebase_on_runner }}/web
# TODO: Since this should now be a functional environment, we could trigger some Playwright tests next.
- name: Start Apache Service
run: sudo systemctl start apache2