Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Add Tugboat configuration. #327

Add Tugboat configuration.

Add Tugboat configuration. #327

Workflow file for this run

name: Main
on:
push:
branches: [ main, wip ]
pull_request:
branches: [ main ]
schedule:
# Every twelve (12) hours.
# @see https://crontab.guru/every-12-hours
- cron: 0 */12 * * *
workflow_dispatch:
jobs:
build:
runs-on: "${{ matrix.os }}-latest"
strategy:
fail-fast: false
matrix:
os: [ ubuntu ]
php: [ 8.1, 8.2, 8.3 ]
steps:
- name: Checkout code
uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
- name: Create project
run: |
set -o xtrace
# Prepare the target directory.
sudo mkdir -p /var/www
sudo rm -rf /var/www/*
sudo chmod 777 /var/www
# Create the project.
git branch -f main || true
git checkout main
composer create-project \
--stability=dev \
--repository='{"type":"vcs","url":"'"$(pwd)"'"}' \
--ansi \
drupal/starshot-project \
/var/www
cd /var/www
# Enable verbose error logging (debug mode).
./vendor/bin/drush config:set --yes system.logging error_level verbose
./vendor/bin/drush config:get system.logging error_level
# @todo The above Drush command doesn't ultimately take effect
# for some reason. Manually change the settings until it can
# be debugged.
echo "if (file_exists(__DIR__ . '/settings.local.php')) {
include __DIR__ . '/settings.local.php';
}" | sudo tee -a web/sites/default/settings.php
sudo cp web/sites/example.settings.local.php \
web/sites/default/settings.local.php
# Make everything writable.
sudo chmod -R 777 /var/www/web
- name: Set up Apache on Linux
if: runner.os == 'Linux'
run: |
set -o xtrace
# Install Apache w/ PHP.
sudo add-apt-repository ppa:ondrej/php
sudo add-apt-repository ppa:ondrej/apache2
sudo apt update
sudo apt install \
apache2 \
php${{ matrix.php }} \
php${{ matrix.php }}-dom \
php${{ matrix.php }}-gd \
php${{ matrix.php }}-pdo \
php${{ matrix.php }}-simplexml \
php${{ matrix.php }}-sqlite3 \
php${{ matrix.php }}-tokenizer \
php${{ matrix.php }}-xml \
libapache2-mod-php${{ matrix.php }}
sudo a2enmod php${{ matrix.php }}
# Change the default site web directory.
sudo sed -i 's/\/var\/www\/html/\/var\/www\/web/g' /etc/apache2/sites-enabled/000-default.conf
# Start the service.
sudo service apache2 start
- name: Debugging
run: |
php -v | head -1
echo
php /var/www/vendor/bin/drush core:status
- name: Test
run: |
curl http://localhost/ 2>/dev/null