Skip to content

Instantly share code, notes, and snippets.

@Olein-jp
Last active November 4, 2021 00:59
Show Gist options
  • Save Olein-jp/a77776923d3862e6850297ec7a8050b3 to your computer and use it in GitHub Desktop.
Save Olein-jp/a77776923d3862e6850297ec7a8050b3 to your computer and use it in GitHub Desktop.
YAML for file uploading via FTP when you pushed master branch with new tag
name: Deploy via Github Actions to Production
on:
push:
branches:
- main
tags:
- '[0-9]+.[0-9]+.[0-9]*'
jobs:
test:
name: Deploy to server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Sync files
uses: SamKirkland/FTP-Deploy-Action@4.1.0
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
server-dir: ${{ secrets.FTP_SERVER_DIR }}
exclude: "[**/.**/**, .gitignore, **/.git/**, **/node_modules/**, **/vendor/**, .editorconfig, README.md, .phpcs.xml.dist, **.json, **.lock, postcss.config.js, **/src/**]"
@Olein-jp
Copy link
Author

Olein-jp commented Nov 4, 2021

Assumed situation

  • on XSERVER
  • Using secrets in GitHub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment