Created
May 11, 2022 14:55
-
-
Save kaelri/d83405c9bca81aa26447b1540edec5e9 to your computer and use it in GitHub Desktop.
Use git-ftp to sync the latest commit’s files to an (S)FTP destination.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to Production | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
web-deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get Code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 10 | |
- name: Sync Files | |
shell: bash | |
env: | |
FTP_URL: ${{secrets.PROD_FTP_URL}} | |
FTP_USERNAME: ${{secrets.PROD_FTP_USERNAME}} | |
FTP_PASSWORD: ${{secrets.PROD_FTP_PASSWORD}} | |
run: | | |
sudo apt-get update | |
sudo apt-get -qq install git-ftp | |
git ftp push --force --auto-init --verbose --syncroot ./ --user "$FTP_USERNAME" --passwd "$FTP_PASSWORD" --insecure "$FTP_URL" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment