-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (35 loc) · 1.03 KB
/
upload.yml
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
on:
pull_request:
types: [closed]
env:
PASSWORD: ${{ secrets.FTP_PASS }}
USER: ${{ secrets.FTP_USER }}
SERVER: ${{32}}
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy to ftp server
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check pull request
uses: actions/github-script@v3
id: set-result
with:
script: |
return github.pulls.listFiles({owner: context.payload.repository.owner.login, repo: context.payload.repository.name, pull_number: context.payload.number})
.then(resp =>
resp.data.map(
file => ({filename: file.filename, status: file.status})
)
)
- name: Upload files to ftp server
uses: ./
id: upload-to-ftp
with:
files: ${{steps.set-result.outputs.result}}
ftpUsername: ${{USER}}
ftpPassword: ${{PASSWORD}}
ftpHostname: ${{SERVER}}
src: test_folder
dest: '/test_dir'