All Projects → SamKirkland → Ftp Deploy Action

SamKirkland / Ftp Deploy Action

Licence: mit
Deploys a GitHub project to a FTP server using GitHub actions

Programming Languages

typescript
32286 projects

Labels

Projects that are alternatives of or similar to Ftp Deploy Action

cuda-toolkit
GitHub Action to install CUDA
Stars: ✭ 34 (-95.5%)
Mutual labels:  action
action
A GitHub Action that deploys live environments for your pull requests and branches
Stars: ✭ 63 (-91.67%)
Mutual labels:  action
React Native Actions Sheet
A Cross Platform(Android & iOS) ActionSheet with a flexible api, native performance and zero dependency code for react native. Create anything you want inside ActionSheet.
Stars: ✭ 412 (-45.5%)
Mutual labels:  action
action-sync-node-meta
GitHub Action that syncs package.json with the repository metadata.
Stars: ✭ 25 (-96.69%)
Mutual labels:  action
upx-action
Strips and runs upx on binaries
Stars: ✭ 17 (-97.75%)
Mutual labels:  action
Compressed Size Action
GitHub Action that adds compressed size changes to your PRs.
Stars: ✭ 300 (-60.32%)
Mutual labels:  action
action-autotag
Automatically generate a new tag when the manifest file (package.json, Dockerfile, custom file, etc) version changes.
Stars: ✭ 45 (-94.05%)
Mutual labels:  action
Redux Ecosystem Links
A categorized list of Redux-related addons, libraries, and utilities
Stars: ✭ 5,076 (+571.43%)
Mutual labels:  action
hookr
PHP action and filter hook system
Stars: ✭ 39 (-94.84%)
Mutual labels:  action
Gascontent
Repo to gather all Gameplay Ability System content for UE4
Stars: ✭ 398 (-47.35%)
Mutual labels:  action
k-redux-factory
Factory of Redux reducers and their associated actions and selectors.
Stars: ✭ 18 (-97.62%)
Mutual labels:  action
github-run-tests-action
mabl Github Actions implementation
Stars: ✭ 39 (-94.84%)
Mutual labels:  action
Ctrpf Ar Cheat Codes
[Database] CTRPF AR CHEAT CODES TO BE USED WITH CTRPF WITH ACTION REPLAY SUPPORT
Stars: ✭ 310 (-58.99%)
Mutual labels:  action
gha-setup-scancentral-client
GitHub Action to set up Fortify ScanCentral Client
Stars: ✭ 15 (-98.02%)
Mutual labels:  action
Rest In Action
REST in Action 《REST 实战》。基于 Jersey 构建 RESTful 服务。
Stars: ✭ 472 (-37.57%)
Mutual labels:  action
server-action-service
Generic and reusable Lightning service component that calls server-side actions
Stars: ✭ 19 (-97.49%)
Mutual labels:  action
Golangci Lint Action
Official GitHub action for golangci-lint from it's authors
Stars: ✭ 270 (-64.29%)
Mutual labels:  action
Elasticviews
✨ An easy way to implement an elastic touch effect for Android.
Stars: ✭ 588 (-22.22%)
Mutual labels:  action
Naev
Naev is a 2d action/rpg space game that combines elements from the action, rpg and simulation genres.
Stars: ✭ 482 (-36.24%)
Mutual labels:  action
Ssh Agent
GitHub Action to setup `ssh-agent` with a private key
Stars: ✭ 365 (-51.72%)
Mutual labels:  action

FTP Deploy Action - Continuous integration for everyone

Automate deploying websites and more with this GitHub action. It's free!

FTP test FTPS test


Usage Example

Place the following in /.github/workflows/main.yml

on: push
name: 🚀 Deploy website on push
jobs:
  web-deploy:
    name: 🎉 Deploy
    runs-on: ubuntu-latest
    steps:
    - name: 🚚 Get latest code
      uses: actions/[email protected]
    
    - name: 📂 Sync files
      uses: SamKirkland/[email protected]
      with:
        server: ftp.samkirkland.com
        username: myFtpUserName
        password: ${{ secrets.ftp_password }}

Requirements

  • You must have ftp access to your server. If your host requires ssh please use my web-deploy action (coming soon)
  • Some web hosts change the default port (21), check with your host for your port number

Setup Steps

  1. Select the repository you want to add the action to
  2. Select the Actions tab
  3. Select Blank workflow file or Set up a workflow yourself, if you don't see these options manually create a yaml file Your_Project/.github/workflows/main.yml
  4. Paste the example above into your yaml file and save
  5. Now you need to add a key to the secrets section in your project. To add a secret go to the Settings tab in your project then select Secrets. Add a new Secret for password
  6. Update your yaml file settings
  7. If you appreciate this github action give it a ⭐️ or show off with one of the badges below.

Settings

Keys can be added directly to your .yml config file or referenced from your project Secrets storage.

To add a secret go to the Settings tab in your project then select Secrets. I strongly recommend you store your password as a secret.

Key Name Required Example Default Value Description
server Yes ftp.samkirkland.com Deployment destination server
username Yes [email protected] FTP user name
password Yes CrazyUniquePassword&%123 FTP password, be sure to escape quotes and spaces
port No 990 21 Server port to connect to (read your web hosts docs)
protocol No ftps ftp ftp: provides no encryption, ftps: full encryption newest standard (aka "explicit" ftps), ftps-legacy: full encryption legacy standard (aka "implicit" ftps)
local-dir No ./myFolderToPublish/ ./ Folder to upload from, must end with trailing slash /
server-dir No public_html/www/ ./ Folder to upload to (on the server), must end with trailing slash /
state-name No folder/.sync-state.json .ftp-deploy-sync-state.json Path and name of the state file - this file is used to track which files have been deployed
dry-run No true false Prints which modifications will be made with current config options, but doesn't actually make any changes
dangerous-clean-slate No true false Deletes ALL contents of server-dir, even items in excluded with 'exclude' argument
exclude No .git* .git*/** node_modules/** node_modules/**/* An array of glob patterns, these files will not be included in the publish/delete process. List must be in yaml array format
log-level No minimal standard minimal: only important info, standard: important info and basic file changes, verbose: print everything the script is doing
security No strict loose strict: Reject any connection which is not authorized with the list of supplied CAs. loose: Allow connection even when the domain is not certificate

Common Examples

Build and Publish React/Angular/Vue Website

Make sure you have an npm script named 'build'. This config should work for most node built websites.

on: push
name: 🚀 Deploy website on push
jobs:
  web-deploy:
    name: 🎉 Deploy
    runs-on: ubuntu-latest
    steps:
    - name: 🚚 Get latest code
      uses: actions/[email protected]

    - name: Use Node.js 12
      uses: actions/[email protected]
      with:
        node-version: '12'
      
    - name: 🔨 Build Project
      run: |
        npm install
        npm run build
    
    - name: 📂 Sync files
      uses: SamKirkland/[email protected]
      with:
        server: ftp.samkirkland.com
        username: myFtpUserName
        password: ${{ secrets.password }}

FTPS

on: push
name: 🚀 Deploy website on push
jobs:
  web-deploy:
    name: 🎉 Deploy
    runs-on: ubuntu-latest
    steps:
    - name: 🚚 Get latest code
      uses: actions/[email protected]

    - name: 📂 Sync files
      uses: SamKirkland/[email protected]
      with:
        server: ftp.samkirkland.com
        username: myFtpUserName
        password: ${{ secrets.password }}
        protocol: ftps
        port: 1234 # todo replace with your web hosts ftps port

Log only dry run: Use this mode for testing

Ouputs a list of files that will be created/modified to sync your source without making any actual changes

on: push
name: 🚀 Deploy website on push
jobs:
  web-deploy:
    name: 🎉 Deploy
    runs-on: ubuntu-latest
    steps:
    - name: 🚚 Get latest code
      uses: actions/[email protected]

    - name: 📂 Sync files
      uses: SamKirkland/[email protected]
      with:
        server: ftp.samkirkland.com
        username: myFtpUserName
        password: ${{ secrets.password }}
        dry-run: true

Exclude files

Excludes files

on: push
name: 🚀 Deploy website on push
jobs:
  web-deploy:
    name: 🎉 Deploy
    runs-on: ubuntu-latest
    steps:
    - name: 🚚 Get latest code
      uses: actions/[email protected]

    - name: 📂 Sync files
      uses: SamKirkland/[email protected]
      with:
        server: ftp.samkirkland.com
        username: myFtpUserName
        password: ${{ secrets.password }}
        exclude: .git*
          - .git*/**
          -  **/.git*/**
          - node_modules/**
          - node_modules/**/*

Want another example? Let me know by creating a github issue


Badge

If you appreciate this github action give it a ⭐️ or show off with one of the badges below. Feel free to edit the text or color.

Deployed with FTP Deploy Action

[<img alt="Deployed with FTP Deploy Action" src="https://img.shields.io/badge/Deployed With-FTP DEPLOY ACTION-%3CCOLOR%3E?style=for-the-badge&color=0077b6">](https://github.com/SamKirkland/FTP-Deploy-Action)

Deployed with FTP Deploy Action

[<img alt="Deployed with FTP Deploy Action" src="https://img.shields.io/badge/Deployed With-FTP DEPLOY ACTION-%3CCOLOR%3E?style=for-the-badge&color=2b9348">](https://github.com/SamKirkland/FTP-Deploy-Action)

Deployed with FTP Deploy Action

[<img alt="Deployed with FTP Deploy Action" src="https://img.shields.io/badge/Deployed With-FTP DEPLOY ACTION-%3CCOLOR%3E?style=for-the-badge&color=d00000">](https://github.com/SamKirkland/FTP-Deploy-Action)

Website Deployed for Free with FTP Deploy Action

[<img alt="Website Deployed for Free with FTP Deploy Action" src="https://img.shields.io/badge/Website deployed for free with-FTP DEPLOY ACTION-%3CCOLOR%3E?style=for-the-badge&color=297FA9">](https://github.com/SamKirkland/FTP-Deploy-Action)

Website Deployed for Free with FTP Deploy Action

[<img alt="Website Deployed for Free with FTP Deploy Action" src="https://img.shields.io/badge/Website deployed for free with-FTP DEPLOY ACTION-%3CCOLOR%3E?style=for-the-badge&color=2b9348">](https://github.com/SamKirkland/FTP-Deploy-Action)

Website Deployed for Free with FTP Deploy Action

[<img alt="Website Deployed for Free with FTP Deploy Action" src="https://img.shields.io/badge/Website deployed for free with-FTP DEPLOY ACTION-%3CCOLOR%3E?style=for-the-badge&color=d00000">](https://github.com/SamKirkland/FTP-Deploy-Action)

FAQ

How to exclude .git files from the publish

Git files are excluded by default! If you customize the exclude option make sure you re-add the default options.

How to exclude a specific file or folder

You can use the exclude option to ignore specific files/folders from the publish. Keep in mind you will need to re-add the default exclude options if you want to keep them. For example the below option excludes all .txt files.

exclude: '*.txt'
How do I set a upload timeout?

github has a built-in timeout-minutes option, see customized example below

on: push
name: Publish Website
jobs:
  web-deploy:
    name: web-deploy
    runs-on: ubuntu-latest
    timeout-minutes: 15 # time out after 15 minutes (default is 360 minutes)
    steps:
      ....

Debugging your config locally

This action is a basic wrapper around my @samkirkland/ftp-deploy npm package. To test your config you can install @samkirkland/ftp-deploy and then convert your config to a yml action. Settings are one-to-one, this action is only a wrapper.

Contributing to this project

To test this action locally you will need to setup docker and act to run a environment similar to the one github uses for actions.

  • Download/install docker for windows, make sure it is running
  • choco install act-cli install act
  • Install the npm package using npm install --dev-only @samkirkland/ftp-deploy
  • Update the deploy script in package.json with a actual server/username/password
  • You can run the script using the following command npm run deploy (run this in the folder that has the package.json file)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].