Remove GitHub config
This commit is contained in:
parent
cf978cd749
commit
1fe9a42d8d
4 changed files with 0 additions and 264 deletions
17
.github/dependabot.yml
vendored
17
.github/dependabot.yml
vendored
|
@ -1,17 +0,0 @@
|
||||||
version: 2
|
|
||||||
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: "composer"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "daily"
|
|
||||||
|
|
||||||
- package-ecosystem: "npm"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "daily"
|
|
||||||
|
|
||||||
- package-ecosystem: "github-actions"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "weekly"
|
|
144
.github/workflows/deploy.yml
vendored
144
.github/workflows/deploy.yml
vendored
|
@ -1,144 +0,0 @@
|
||||||
name: Deploy
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
name: Deploy
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
environment: Hetzner
|
|
||||||
env:
|
|
||||||
repository: 'jonnybarnes/jonnybarnes.uk'
|
|
||||||
newReleaseName: '${{ github.run_id }}'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: 🌍 Set Environment Variables
|
|
||||||
run: |
|
|
||||||
echo "releasesDir=${{ secrets.DEPLOYMENT_BASE_DIR }}/releases" >> $GITHUB_ENV
|
|
||||||
echo "persistentDir=${{ secrets.DEPLOYMENT_BASE_DIR }}/persistent" >> $GITHUB_ENV
|
|
||||||
echo "currentDir=${{ secrets.DEPLOYMENT_BASE_DIR }}/current" >> $GITHUB_ENV
|
|
||||||
- name: 🌎 Set Environment Variables Part 2
|
|
||||||
run: |
|
|
||||||
echo "newReleaseDir=${{ env.releasesDir }}/${{ env.newReleaseName }}" >> $GITHUB_ENV
|
|
||||||
- name: 🔄 Clone Repository
|
|
||||||
uses: appleboy/ssh-action@master
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.DEPLOYMENT_HOST }}
|
|
||||||
port: ${{ secrets.DEPLOYMENT_PORT }}
|
|
||||||
username: ${{ secrets.DEPLOYMENT_USER }}
|
|
||||||
key: ${{ secrets.DEPLOYMENT_KEY }}
|
|
||||||
script: |
|
|
||||||
[ -d ${{ env.releasesDir }} ] || mkdir ${{ env.releasesDir }}
|
|
||||||
[ -d ${{ env.persistentDir }} ] || mkdir ${{ env.persistentDir }}
|
|
||||||
[ -d ${{ env.persistentDir }}/storage ] || mkdir ${{ env.persistentDir }}/storage
|
|
||||||
|
|
||||||
cd ${{ env.releasesDir }}
|
|
||||||
|
|
||||||
# Create new release directory
|
|
||||||
mkdir ${{ env.newReleaseDir }}
|
|
||||||
|
|
||||||
# Clone app
|
|
||||||
git clone --depth 1 --branch ${{ github.ref_name }} https://github.com/${{ env.repository }} ${{ env.newReleaseName }}
|
|
||||||
|
|
||||||
# Mark release
|
|
||||||
cd ${{ env.newReleaseDir }}
|
|
||||||
echo "${{ env.newReleaseName }}" > public/release-name.txt
|
|
||||||
|
|
||||||
# Fix cache directory permissions
|
|
||||||
sudo chown -R ${{ secrets.HTTP_USER }}:${{ secrets.HTTP_USER }} bootstrap/cache
|
|
||||||
|
|
||||||
- name: 🎵 Run Composer
|
|
||||||
uses: appleboy/ssh-action@master
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.DEPLOYMENT_HOST }}
|
|
||||||
port: ${{ secrets.DEPLOYMENT_PORT }}
|
|
||||||
username: ${{ secrets.DEPLOYMENT_USER }}
|
|
||||||
key: ${{ secrets.DEPLOYMENT_KEY }}
|
|
||||||
script: |
|
|
||||||
cd ${{ env.newReleaseDir }}
|
|
||||||
composer install --prefer-dist --no-scripts --no-dev --no-progress --optimize-autoloader --quiet --no-interaction
|
|
||||||
|
|
||||||
- name: 🔗 Update Symlinks
|
|
||||||
uses: appleboy/ssh-action@master
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.DEPLOYMENT_HOST }}
|
|
||||||
port: ${{ secrets.DEPLOYMENT_PORT }}
|
|
||||||
username: ${{ secrets.DEPLOYMENT_USER }}
|
|
||||||
key: ${{ secrets.DEPLOYMENT_KEY }}
|
|
||||||
script: |
|
|
||||||
# Import the environment config
|
|
||||||
cd ${{ env.newReleaseDir }};
|
|
||||||
ln -nfs ${{ secrets.DEPLOYMENT_BASE_DIR }}/.env .env;
|
|
||||||
|
|
||||||
# Remove the storage directory and replace with persistent data
|
|
||||||
rm -rf ${{ env.newReleaseDir }}/storage;
|
|
||||||
cd ${{ env.newReleaseDir }};
|
|
||||||
ln -nfs ${{ secrets.DEPLOYMENT_BASE_DIR }}/persistent/storage storage;
|
|
||||||
|
|
||||||
# Remove the public/profile-images directory and replace with persistent data
|
|
||||||
rm -rf ${{ env.newReleaseDir }}/public/assets/profile-images;
|
|
||||||
cd ${{ env.newReleaseDir }};
|
|
||||||
ln -nfs ${{ secrets.DEPLOYMENT_BASE_DIR }}/persistent/profile-images public/assets/profile-images;
|
|
||||||
|
|
||||||
# Add the persistent files data
|
|
||||||
cd ${{ env.newReleaseDir }};
|
|
||||||
ln -nfs ${{ secrets.DEPLOYMENT_BASE_DIR }}/persistent/files public/files;
|
|
||||||
|
|
||||||
# Add the persistent fonts data
|
|
||||||
cd ${{ env.newReleaseDir }};
|
|
||||||
ln -nfs ${{ secrets.DEPLOYMENT_BASE_DIR }}/persistent/fonts public/fonts;
|
|
||||||
|
|
||||||
- name: ✨ Optimize Installation
|
|
||||||
uses: appleboy/ssh-action@master
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.DEPLOYMENT_HOST }}
|
|
||||||
port: ${{ secrets.DEPLOYMENT_PORT }}
|
|
||||||
username: ${{ secrets.DEPLOYMENT_USER }}
|
|
||||||
key: ${{ secrets.DEPLOYMENT_KEY }}
|
|
||||||
script: |
|
|
||||||
cd ${{ env.newReleaseDir }};
|
|
||||||
sudo runuser -u ${{ secrets.HTTP_USER }} -- php artisan clear-compiled;
|
|
||||||
|
|
||||||
- name: 🙈 Migrate database
|
|
||||||
uses: appleboy/ssh-action@master
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.DEPLOYMENT_HOST }}
|
|
||||||
port: ${{ secrets.DEPLOYMENT_PORT }}
|
|
||||||
username: ${{ secrets.DEPLOYMENT_USER }}
|
|
||||||
key: ${{ secrets.DEPLOYMENT_KEY }}
|
|
||||||
script: |
|
|
||||||
cd ${{ env.newReleaseDir }}
|
|
||||||
sudo runuser -u ${{ secrets.HTTP_USER }} -- php artisan migrate --force
|
|
||||||
|
|
||||||
- name: 🙏 Bless release
|
|
||||||
uses: appleboy/ssh-action@master
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.DEPLOYMENT_HOST }}
|
|
||||||
port: ${{ secrets.DEPLOYMENT_PORT }}
|
|
||||||
username: ${{ secrets.DEPLOYMENT_USER }}
|
|
||||||
key: ${{ secrets.DEPLOYMENT_KEY }}
|
|
||||||
script: |
|
|
||||||
ln -nfs ${{ env.newReleaseDir }} ${{ env.currentDir }};
|
|
||||||
cd ${{ env.newReleaseDir }}
|
|
||||||
sudo runuser -u ${{ secrets.HTTP_USER }} -- php artisan horizon:terminate
|
|
||||||
sudo runuser -u ${{ secrets.HTTP_USER }} -- php artisan config:cache
|
|
||||||
sudo runuser -u ${{ secrets.HTTP_USER }} -- php artisan event:cache
|
|
||||||
sudo runuser -u ${{ secrets.HTTP_USER }} -- php artisan route:cache
|
|
||||||
sudo runuser -u ${{ secrets.HTTP_USER }} -- php artisan view:cache
|
|
||||||
|
|
||||||
sudo systemctl restart php-fpm.service
|
|
||||||
sudo systemctl restart jbuk-horizon.service
|
|
||||||
|
|
||||||
- name: 🚾 Clean up old releases
|
|
||||||
uses: appleboy/ssh-action@master
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.DEPLOYMENT_HOST }}
|
|
||||||
port: ${{ secrets.DEPLOYMENT_PORT }}
|
|
||||||
username: ${{ secrets.DEPLOYMENT_USER }}
|
|
||||||
key: ${{ secrets.DEPLOYMENT_KEY }}
|
|
||||||
script: |
|
|
||||||
fd '.+' ${{ env.releasesDir }} -d 1 | head -n -3 | xargs -d "\n" -I'{}' sudo chown -R ${{ secrets.DEPLOYMENT_USER }}:${{ secrets.DEPLOYMENT_USER }} {}
|
|
||||||
fd '.+' ${{ env.releasesDir }} -d 1 | head -n -3 | xargs -d "\n" -I'{}' rm -rf {}
|
|
65
.github/workflows/phpunit.yml
vendored
65
.github/workflows/phpunit.yml
vendored
|
@ -1,65 +0,0 @@
|
||||||
name: PHP Unit
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
phpunit:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
name: PHPUnit test suite
|
|
||||||
|
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgres:latest
|
|
||||||
env:
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
POSTGRES_DB: jbukdev_testing
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup PHP
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
php-version: '8.3'
|
|
||||||
extensions: mbstring, intl, phpredis, imagick
|
|
||||||
coverage: xdebug
|
|
||||||
tools: phpunit
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Copy .env
|
|
||||||
run: php -r "file_exists('.env') || copy('.env.github', '.env');"
|
|
||||||
|
|
||||||
- name: Get Composer Cache Directory
|
|
||||||
id: composer-cache
|
|
||||||
run: |
|
|
||||||
echo "::set-output name=dir::$(composer config cache-files-dir)"
|
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: ${{ steps.composer-cache.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-php-8.3-composer-${{ hashFiles('**/composer.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-php-8.3-composer-
|
|
||||||
|
|
||||||
- name: Install Composer Dependencies
|
|
||||||
run: composer install --quiet --no-ansi --no-interaction --no-progress
|
|
||||||
|
|
||||||
- name: Generate Key
|
|
||||||
run: php artisan key:generate
|
|
||||||
|
|
||||||
- name: Setup Directory Permissions
|
|
||||||
run: chmod -R 777 storage bootstrap/cache
|
|
||||||
|
|
||||||
- name: Setup Database
|
|
||||||
run: php artisan migrate
|
|
||||||
|
|
||||||
- name: Execute PHPUnit Tests
|
|
||||||
run: vendor/bin/phpunit
|
|
38
.github/workflows/pint.yml
vendored
38
.github/workflows/pint.yml
vendored
|
@ -1,38 +0,0 @@
|
||||||
name: Laravel Pint
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
pint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
name: Laravel Pint
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup PHP with pecl extensions
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
php-version: '8.2'
|
|
||||||
|
|
||||||
- name: Get Composer Cache Directory
|
|
||||||
id: composer-cache
|
|
||||||
run: |
|
|
||||||
echo "::set-output name=dir::$(composer config cache-files-dir)"
|
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: ${{ steps.composer-cache.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-composer-
|
|
||||||
|
|
||||||
- name: Install Composer Dependencies
|
|
||||||
run: composer install --quiet --no-ansi --no-interaction --no-progress
|
|
||||||
|
|
||||||
- name: Check Files with Laravel Pint
|
|
||||||
run: vendor/bin/pint --test
|
|
Loading…
Add table
Reference in a new issue