Skip to content

Instantly share code, notes, and snippets.

@devprantoroy
Created April 18, 2023 05:34
Show Gist options
  • Save devprantoroy/0058c7a5e7523bce97972e0a495dd257 to your computer and use it in GitHub Desktop.
Save devprantoroy/0058c7a5e7523bce97972e0a495dd257 to your computer and use it in GitHub Desktop.
Simple Deploy on git push Laravel CICD
name: Deploy Laravel Project on push
on:
push:
branches:
- main
jobs:
web-deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Get the latest code
uses: actions/checkout@v2.3.2
- uses: actions/setup-node@master
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install Dependencies
run: composer update --ignore-platform-reqs
- name: Generate key
run: php artisan key:generate
- name: Generate storage link
run: php artisan storage:link
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: 📂 Sync files
uses: SamKirkland/FTP-Deploy-Action@4.0.0
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
server-dir: /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment