Forked from Robiussani152/github-action-push-to-server.yml
Last active
March 15, 2022 15:41
-
-
Save mamun724682/cd82eaa8f52b7c266f6fe7b034f70e48 to your computer and use it in GitHub Desktop.
Github action for laravel shared hosting SSH Deploy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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