Skip to content

Merge pull request #147 from devmount/dependabot/composer/league/comm… #114

Merge pull request #147 from devmount/dependabot/composer/league/comm…

Merge pull request #147 from devmount/dependabot/composer/league/comm… #114

Workflow file for this run

# This workflow will do a clean install of node dependencies,
# build the frontend, push files to remote dev and remotely build backend
# as soon as there are pushes to the main branch
name: Build & Deploy (Stage)
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Push project files to testing environment
uses: burnett01/rsync-deployments@v8
with:
switches: -avzr --exclude '.git*' --exclude '.ddev' --exclude 'node_modules' --exclude '.editorconfig' --exclude '.env.*' --exclude 'vendor' --exclude 'storage'
path: ./
remote_path: ${{ secrets.DEPLOY_PATH_STAGE }}
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_port: ${{ secrets.DEPLOY_PORT }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_SSH_KEY }}
remote_key_pass: ${{ secrets.DEPLOY_SSH_PHRASE }}
- name: Build backend
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.DEPLOY_HOST }}
port: ${{ secrets.DEPLOY_PORT }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
passphrase: ${{ secrets.DEPLOY_SSH_PHRASE }}
script: |
cd ${{ secrets.DEPLOY_PATH_STAGE }}
php8.4 -f /usr/bin/composer update -qn
php8.4 -f /usr/bin/composer install -qno --no-ansi --no-scripts --no-progress
php8.4 artisan migrate --force
php8.4 artisan config:clear
php8.4 artisan config:cache
php8.4 artisan route:clear
php8.4 artisan route:cache
php8.4 artisan view:clear
php8.4 artisan view:cache
php8.4 artisan icons:cache
rm -rf node_modules .git* .editorconfig .env.* *.config.js .ddev