From 1fe9a42d8d3e6181f5c9dafd308e5a1787a71e6d Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Mon, 7 Apr 2025 19:47:48 +0100 Subject: [PATCH] Remove GitHub config --- .github/dependabot.yml | 17 ---- .github/workflows/deploy.yml | 144 ---------------------------------- .github/workflows/phpunit.yml | 65 --------------- .github/workflows/pint.yml | 38 --------- 4 files changed, 264 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/phpunit.yml delete mode 100644 .github/workflows/pint.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 3ebccbd3..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -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" diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index f66a77b4..00000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -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 {} diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml deleted file mode 100644 index 29afebb9..00000000 --- a/.github/workflows/phpunit.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/pint.yml b/.github/workflows/pint.yml deleted file mode 100644 index 9b0956ad..00000000 --- a/.github/workflows/pint.yml +++ /dev/null @@ -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