SamKirkland / FTP-Deploy-Action

Deploys a GitHub project to a FTP server using GitHub actions
MIT License
3.77k stars 371 forks source link

Laravel deploy #462

Open yannickdirbe opened 3 months ago

yannickdirbe commented 3 months ago

Please can you show how to use on Laravel deployment with files and folders excludes

solomon-ochepa commented 3 months ago
name: 🚀 Deploye

# Controls when the workflow will run
on:
  # Triggers the workflow on push or pull request events but only for the "main" branch
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
    types: [closed]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "web-deploy"
  web-deploy:
    name: 🎉 Deploying

    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
    # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
    - name: 🚚 Get latest code
      uses: actions/checkout@v4

    # Runs a command using the runners shell
    - name: Install Dependencies
      run: composer update --ignore-platform-reqs

    - name: NodeJS Packages
      run: npm update; npm run build

    - name: Directory Permissions
      run: chmod -R 775 storage

    - name: Clear Caches
      run: php artisan optimize:clear

    - name: Storage link
      run: php artisan storage:link --force

    - name: 📂 Sync files
      uses: SamKirkland/FTP-Deploy-Action@v4.3.5
      with:
        server: ${{ secrets.FTP_SERVER }}
        username: ${{ secrets.FTP_USERNAME }}
        password: ${{ secrets.FTP_PASSWORD }}
        server-dir: ${{ secrets.FTP_SERVER_DIR }}
        log-level: minimal
        exclude: |
          **/.git*
          **/.git*/**
          **/node_modules/**
Coho04 commented 1 month ago

Bro you can use Deployer is better

yannickdirbe commented 1 month ago

Bro you can use Deployer is better

Thank you @Coho04 ! I will check it.

SHJordan commented 4 weeks ago

Bro you can use Deployer is better

Thank you @Coho04 ! I will check it.

I believe it will not work for shared hosts without ssh tho, right?