Skip to content

Instantly share code, notes, and snippets.

@Robiussani152
Created March 15, 2022 03:51
Show Gist options
  • Save Robiussani152/98d204e970896b3ab35c1130a161edef to your computer and use it in GitHub Desktop.
Save Robiussani152/98d204e970896b3ab35c1130a161edef to your computer and use it in GitHub Desktop.
name: push-to-do-server
on:
push:
branches: [ main ]
jobs:
automatic-deploy:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
with:
php-version: '8.0'
- uses: actions/checkout@v2
- name: Push to cpanel using ssh key
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: |
cd /home/biyerjuti_dev/web/biyerjuti.com/public_html
git pull
php -r "file_exists('.env') || copy('.env.example', '.env');"
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
php artisan key:generate
php artisan migrate
php artisan optimize:clear
chmod 775 -R ./storage
chown -R biyerjuti_dev:www-data ./storage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment