-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple Folders and FTPs #37
Comments
Thanks, I'm glad you like it!
on: push
name: Publish Website
jobs:
FTP-Deploy-Action:
name: FTP-Deploy-Action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Deploy to first folder
uses: SamKirkland/FTP-Deploy-Action@2.0.0
env:
FTP_SERVER: ftp.samkirkland.com
FTP_USERNAME: myFtpUserName
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
REMOTE_DIR: firstCopyOfEverything
ARGS: --delete
- name: Deploy to second folder
uses: SamKirkland/FTP-Deploy-Action@2.0.0
env:
FTP_SERVER: ftp.samkirkland.com
FTP_USERNAME: myFtpUserName
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
REMOTE_DIR: secondCopyOfEverything
ARGS: --delete
on: push
name: Publish Website
jobs:
FTP-Deploy-Action:
name: FTP-Deploy-Action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Deploy to first server
uses: SamKirkland/FTP-Deploy-Action@2.0.0
env:
FTP_SERVER: ftp.first-server.com
FTP_USERNAME: myFtpUserName
FTP_PASSWORD: ${{ secrets.FIRST_SERVER_FTP_PASSWORD }}
ARGS: --delete
- name: Deploy to second server
uses: SamKirkland/FTP-Deploy-Action@2.0.0
env:
FTP_SERVER: ftp.second-server.com
FTP_USERNAME: myFtpUserName
FTP_PASSWORD: ${{ secrets.SECOND_SERVER_FTP_PASSWORD }}
ARGS: --delete |
Thank you very much Sam Kirland, I really appreciate that
From: Sam Kirkland <notifications@github.com>
Sent: Wednesday, January 8, 2020 9:03 PM
To: SamKirkland/FTP-Deploy-Action <FTP-Deploy-Action@noreply.github.com>
Cc: Ogunyemi Oludayo <dayo@mooreadvice.com>; Author <author@noreply.github.com>
Subject: Re: [SamKirkland/FTP-Deploy-Action] Multiple Folders and FTPs (#37)
Thanks, I'm glad you like it!
1. Are you looking to deploy the same code to multiple folders? The FTP protocol only supports uploading/downloading files and doesn't provide a way to duplicate files on the server. If you have SSH access to the server you could connect to it and run a copy command. If you are okay with uploading the file multiple times (longer deploy times & more bandwidth usage) you can simply run the action multiple times for each destination folder.
on: push
name: Publish Website
jobs:
FTP-Deploy-Action:
name: FTP-Deploy-Action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Deploy to first folder
uses: SamKirkland/FTP-Deploy-Action@2.0.0
env:
FTP_SERVER: ftp.samkirkland.com
FTP_USERNAME: myFtpUserName
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
REMOTE_DIR: firstCopyOfEverything
ARGS: --delete
- name: Deploy to second folder
uses: SamKirkland/FTP-Deploy-Action@2.0.0
env:
FTP_SERVER: ftp.samkirkland.com
FTP_USERNAME: myFtpUserName
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
REMOTE_DIR: secondCopyOfEverything
ARGS: --delete
2. Similar to the above example, you can trigger multiple instance of FTP-Deploy-Action per commit, each instance can have it's own server config.
on: push
name: Publish Website
jobs:
FTP-Deploy-Action:
name: FTP-Deploy-Action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Deploy to first server
uses: SamKirkland/FTP-Deploy-Action@2.0.0
env:
FTP_SERVER: ftp.first-server.com
FTP_USERNAME: myFtpUserName
FTP_PASSWORD: ${{ secrets.FIRST_SERVER_FTP_PASSWORD }}
ARGS: --delete
- name: Deploy to second server
uses: SamKirkland/FTP-Deploy-Action@2.0.0
env:
FTP_SERVER: ftp.second-server.com
FTP_USERNAME: myFtpUserName
FTP_PASSWORD: ${{ secrets.SECOND_SERVER_FTP_PASSWORD }}
ARGS: --delete
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#37?email_source=notifications&email_token=ALW72A7AI7TVFU5RBS52JYLQ4YWPVA5CNFSM4KEL6WR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEINZMXA#issuecomment-572233308> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ALW72A4KTIMQPQYVZTGRFYTQ4YWPVANCNFSM4KEL6WRQ> .
|
Hello SamKirkland Thanks once again for your response, it was helpful.
Thanks |
I'd approach this by creating two action yaml files. One for the dev environment, another for production. See github's documentation on:
# Trigger only for the development branch
# Only trigger on push. You can also trigger this on [push, pull_requests] etc...
push:
branches:
- development
name: Publish Development Website
jobs:
FTP-Deploy-Action:
name: FTP-Deploy-Action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Deploy to first folder
uses: SamKirkland/FTP-Deploy-Action@2.0.0
env:
FTP_SERVER: ftp.samkirkland.com
FTP_USERNAME: devEnvFTPAccount
FTP_PASSWORD: ${{ secrets.DEV_FTP_PASSWORD }}
ARGS: --delete Then create another yaml file and tell it to run only on the master branch on:
# Trigger only for the development branch
# You can also trigger this on pull_requests, etc...
push:
branches:
- master
name: Publish Production Website
# see above ... |
From: Sam Kirkland <notifications@github.com>
Sent: Wednesday, January 29, 2020 4:45 PM
To: SamKirkland/FTP-Deploy-Action <FTP-Deploy-Action@noreply.github.com>
Cc: Ogunyemi Oludayo <dayo@mooreadvice.com>; Author <author@noreply.github.com>
Subject: Re: [SamKirkland/FTP-Deploy-Action] Multiple Folders and FTPs (#37)
Thanks once again, it works and I really appreciate
Thanks and regards
I'd approach this by creating two action yaml files. One for the dev environment, another for production. See github's documentation <https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#example-using-multiple-events-with-activity-types-or-configuration>
on:
# Trigger only for the development branch
# Only trigger on push. You can also trigger this on [push, pull_requests] etc...
push:
branches:
- development
name: Publish Development Website
jobs:
FTP-Deploy-Action:
name: FTP-Deploy-Action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Deploy to first folder
uses: SamKirkland/FTP-Deploy-Action@2.0.0 <mailto:SamKirkland/FTP-Deploy-Action@2.0.0>
env:
FTP_SERVER: ftp.samkirkland.com <ftp://ftp.samkirkland.com>
FTP_USERNAME: devEnvFTPAccount
FTP_PASSWORD: ${{ secrets.DEV_FTP_PASSWORD }}
ARGS: --delete
Then create another yaml file and tell it to run only on the master branch
on:
# Trigger only for the development branch
# You can also trigger this on pull_requests, etc...
push:
branches:
- master
name: Publish Production Website
# see above ...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#37?email_source=notifications&email_token=ALW72AZ22UH33JXHMBDQVJTRAGP7DA5CNFSM4KEL6WR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKHVPXQ#issuecomment-579819486> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ALW72A2QZTWVVH2BRVW5ZW3RAGP7DANCNFSM4KEL6WRQ> . <https://github.com/notifications/beacon/ALW72AY3D7L54G4SMM225MDRAGP7DA5CNFSM4KEL6WR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKHVPXQ.gif>
|
First of all, thanks to all that contribute to this, it is really helpful, thanks once again.
1 I want to ask what if I want to deploy to multiple folders on the same servers specifying the different folders, how do I go about it,
2 What if I want to deploy to multiple servers with different servers, each with their own server config.
Thanks
The text was updated successfully, but these errors were encountered: