-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
66 lines (60 loc) · 1.63 KB
/
Copy pathaction.yml
File metadata and controls
66 lines (60 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: 'python ftp deploy'
description: 'A GitHub Action to upload files to an FTP server'
author: 'Akila Indunil'
inputs:
host:
description: 'FTP server hostname'
required: true
username:
description: 'FTP server username'
required: true
password:
description: 'FTP server password'
required: true
ftpdir:
description: 'FTP server directory (default: ./)'
required: false
default: './'
localdir:
description: 'Local directory to upload (default: ./)'
required: false
default: './'
hashfile:
description: 'Name of the hash file (default: .file_hashes.json)'
required: false
default: '.file_hashes.json'
runs:
using: 'composite'
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Checkout repository
uses: actions/checkout@v2
- name: Verify repository contents
shell: bash
run: ls -la
- name: Copy FTP upload script
shell: bash
run: |
if [ -f ftp_upload.py ]; then
cp ftp_upload.py $GITHUB_WORKSPACE
echo "Copied ftp_upload.py to $GITHUB_WORKSPACE"
else
echo "ftp_upload.py not found in the repository"
exit 1
fi
- name: Run FTP Upload Script
shell: bash
run: python $GITHUB_WORKSPACE/ftp_upload.py
env:
FTP_HOST: ${{ inputs.host }}
FTP_USERNAME: ${{ inputs.username }}
FTP_PASSWORD: ${{ inputs.password }}
FTP_DIR: ${{ inputs.ftpdir }}
LOCAL_DIR: ${{ inputs.localdir }}
HASH_FILE: ${{ inputs.hashfile }}
branding:
icon: 'upload'
color: 'blue'