Created
June 6, 2022 20:58
-
-
Save Farid-NL/2d8b3288c7ef57ea1ac4ab75c486fbd0 to your computer and use it in GitHub Desktop.
Deploy Laravel App to Shared Hosting through FTP
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
| on: | |
| push: | |
| branches: | |
| - dev | |
| name: π Deploy website on push | |
| jobs: | |
| web-deploy: | |
| name: π Deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: π Get latest code | |
| uses: actions/checkout@v3 | |
| - name: β Setup node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 16 | |
| - name: β Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 7.4 | |
| - name: π₯ Install node dependencies | |
| run: npm install | |
| - name: π₯ Public files | |
| run: npm run dev | |
| - name: π₯ Copy .env | |
| run: php -r "file_exists('.env') || copy('.env.example', '.env');" | |
| - name: π₯ Install composer dependencies | |
| run: composer install | |
| - name: π₯ Modify APP_URL | |
| run: sed -i 's|APP_URL=|APP_URL=https://dev.dominio.com/|g' .env | |
| - name: π₯ Generate key | |
| run: php artisan key:generate | |
| - name: π₯ Directory Permissions | |
| run: chmod -R 777 storage bootstrap/cache | |
| - name: π Sync files | |
| uses: SamKirkland/[email protected] | |
| with: | |
| server: ftp.tu-servidor.com | |
| username: ${{ secrets.ftp_username }} | |
| password: ${{ secrets.ftp_password }} | |
| server-dir: /ruta/elegida/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment