run main.py #15
Workflow file for this run
This file contains 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: run main.py | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'branch name' | |
required: true | |
jobs: | |
watch-ftp-folder: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Watch FTP folder | |
run: | | |
HOST="your_ftp_host" | |
REMOTE_DIR="path_to_watch" | |
USER=${{ secrets.ACCOUNT_NAME }} | |
PASS=${{ secrets.KEY_PHRASE }} | |
docker run --rm -v $(pwd):/workspace atmoz/make lftp -c "open -u $USER,$PASS $HOST; cd $REMOTE_DIR; mirror --reverse --delete --verbose=3 --only-newer . /tmp/ftp-watch" | |
# Check if any new files were downloaded | |
if [ "$(ls -A /tmp/ftp-watch)" ]; then | |
echo "New files detected on FTP server!" | |
else | |
echo "No new files detected." | |
fi | |