Skip to content
upload

GitHub Action

Deploy Laravel App to FTP Server Action

release Latest version

Deploy Laravel App to FTP Server Action

upload

Deploy Laravel App to FTP Server Action

A GitHub Action to deploy a Laravel project to a server via FTP with customizable PHP versions and extensions

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Deploy Laravel App to FTP Server Action

uses: MadalitsoNyemba/laravel-deploy-to-ftp-action@release

Learn more about this action in MadalitsoNyemba/laravel-deploy-to-ftp-action

Choose a version

Laravel Deploy Action

This GitHub Action deploys a Laravel project to a server via FTP, with customizable PHP versions and extensions.

Inputs

  • branch: The branch to deploy. This input determines which branch (production or development) will be deployed.
  • php-version: PHP version to use (default: 8.1). You can specify any PHP version supported by the shivammathur/setup-php action.
  • php-extensions: Comma-separated list of PHP extensions to install (default: "mbstring,xml,intl,curl,gd"). Modify this list according to your project's requirements.
  • ftp-username-main: FTP username for the main branch. This should be the username used for production deployments.
  • ftp-username-dev: FTP username for the development branch. This should be the username used for development deployments.
  • ftp-server: FTP server address. This is the FTP server where your Laravel project will be deployed.
  • ftp-password: FTP password. This is the password used for FTP deployment.
  • use-env-files: Whether to use .env.prod and .env.dev files (default: true). If set to true, the action will copy .env.prod for production and .env.dev for development. If false, the action will use .env.example.

Usage

Example Workflow

name: Deploy to Server
on: push
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Deploy
        uses: your-username/laravel-deploy-action@v1
        with:
          branch: ${{ github.ref_name }}
          php-version: '8.1'
          php-extensions: 'mbstring,xml,intl,curl,gd'
          ftp-username-main: 'your-main-username'
          ftp-username-dev: 'your-dev-username'
          ftp-server: 'ftp.yourserver.com'
          ftp-password: 'your-ftp-password'
          use-env-files: 'true'

Acknowledgments

This GitHub Action leverages several other amazing GitHub Actions:

These tools make it easy to build and deploy your Laravel applications in a continuous integration/continuous deployment (CI/CD) pipeline.