Skip to content

Commit

Permalink
update readme (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
AkiKurvinen authored Oct 23, 2024
1 parent 50ed727 commit d751f7b
Showing 1 changed file with 67 additions and 57 deletions.
124 changes: 67 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,85 +38,95 @@ This action uploads files to a remote server using the SFTP protocol. Unlike oth
### Upload everything with password

```yaml
uses: actions/checkout@v4
uses: Dylan700/sftp-upload-action@latest
with:
server: sftp.server.com
username: jason-bourne
password: ${{secrets.password}}
port: 22
uploads: |
./ => ./www/public_html/
- name: Checkout
uses: actions/checkout@v4
- name: SFTP upload
uses: Dylan700/sftp-upload-action@latest
with:
server: sftp.server.com
username: jason-bourne
password: ${{secrets.password}}
port: 22
uploads: |
./ => ./www/public_html/
```

### Upload everything with password, ignoring .git

```yaml
uses: actions/checkout@v4
uses: Dylan700/sftp-upload-action@latest
with:
server: sftp.server.com
username: jason-bourne
password: ${{secrets.password}}
port: 22
uploads: |
./ => ./www/public_html/
ignore: |
*.git
*/**/*git*
- name: Checkout
uses: actions/checkout@v4
- name: SFTP upload
uses: Dylan700/sftp-upload-action@latest
with:
server: sftp.server.com
username: jason-bourne
password: ${{secrets.password}}
port: 22
uploads: |
./ => ./www/public_html/
ignore: |
*.git
*/**/*git*
```
### Upload multiple folders with private key
```yaml
uses: actions/checkout@v4
uses: Dylan700/sftp-upload-action@latest
with:
server: sftp.server.com
username: jason-bourne
key: ${{secrets.key}}
passphrase: ${{secrets.passphrase}}
port: 22
uploads: |
./html/ => ./www/public_html/
./src/ => ./www/src/
- name: Checkout
uses: actions/checkout@v4
- name: SFTP upload
uses: Dylan700/sftp-upload-action@latest
with:
server: sftp.server.com
username: jason-bourne
key: ${{secrets.key}}
passphrase: ${{secrets.passphrase}}
port: 22
uploads: |
./html/ => ./www/public_html/
./src/ => ./www/src/
```
### Upload multiples folders and delete existing files in those folders
```yaml
uses: actions/checkout@v4
uses: Dylan700/sftp-upload-action@latest
with:
server: sftp.server.com
username: jason-bourne
key: ${{secrets.key}}
passphrase: ${{secrets.passphrase}}
port: 22
uploads: |
./html/ => ./www/public_html/
./src/ => ./www/src/
delete: 'true'
- name: Checkout
uses: actions/checkout@v4
- name: SFTP upload
uses: Dylan700/sftp-upload-action@latest
with:
server: sftp.server.com
username: jason-bourne
key: ${{secrets.key}}
passphrase: ${{secrets.passphrase}}
port: 22
uploads: |
./html/ => ./www/public_html/
./src/ => ./www/src/
delete: 'true'
```
### Upload Specific Files
Specific files can be uploaded be negating the `ignore` inputs with an exclamation `!` character. The example below will only upload files that have a name matching `index.html` or `.htaccess`.

```yaml
uses: actions/checkout@v4
uses: Dylan700/sftp-upload-action@latest
with:
server: sftp.server.com
username: jason-bourne
key: ${{secrets.key}}
passphrase: ${{secrets.passphrase}}
port: 22
uploads: |
./html/ => ./www/public_html/
ignore: |
!index.html
!.htaccess
- name: Checkout
uses: actions/checkout@v4
- name: SFTP upload
uses: Dylan700/sftp-upload-action@latest
with:
server: sftp.server.com
username: jason-bourne
key: ${{secrets.key}}
passphrase: ${{secrets.passphrase}}
port: 22
uploads: |
./html/ => ./www/public_html/
ignore: |
!index.html
!.htaccess
```

## Contributions
Expand Down

0 comments on commit d751f7b

Please sign in to comment.