Skip to content

MadalitsoNyemba/laravel-deploy-to-ftp-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

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 Laravel App to FTP Server Action       
        uses: MadalitsoNyemba/laravel-deploy-to-ftp-action@release
        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 to FTP servers in a continuous integration/continuous deployment (CI/CD) pipeline.