Skip to content

Instantly share code, notes, and snippets.

@Farid-NL
Created June 6, 2022 20:58
Show Gist options
  • Save Farid-NL/2d8b3288c7ef57ea1ac4ab75c486fbd0 to your computer and use it in GitHub Desktop.
Save Farid-NL/2d8b3288c7ef57ea1ac4ab75c486fbd0 to your computer and use it in GitHub Desktop.
Deploy Laravel App to Shared Hosting through FTP
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