samkirkland / web-deploy Goto Github PK
View Code? Open in Web Editor NEWDeploy your website automatically for free
License: MIT License
Deploy your website automatically for free
License: MIT License
rsync-options: --include not working.
I try to exclude all files by --exclude=* except wp-content/themes folder and files in it by:
--exclude=/* --include=/wp-content/ --include=/wp-content/themes/**
Can you perhaps add in the option to specify "--exclude-from" within the rsync and all excludes will be stored in a separate file?
Bug Description
It's not clear which type of ssh key could be used
You need to write that PEM should be used
ssh-keygen -m PEM -t rsa -b 4096
Bug Description
Not really a bug but i want to be able to supress the :
Warning: Permanently added 'xx.xxx.xxx.xx' (ED25519) to the list of known hosts. from the output in the actions
dont have branch rights so this can be the solution:
actions.yml:
inputs:
suppress-ssh-warning:
description: "Set to true to suppress SSH known hosts warning"
required: false
default: 'false'
main:
suppress_ssh_warning: getInput("suppress-ssh-warning") === 'true'
and
(create if statement)
let sshOptions = -e 'ssh -p ${args.ssh_port} -i ${privateKeyPath} -o StrictHostKeyChecking=no'
;
if (args.suppress_ssh_warning) {
sshOptions = -e 'ssh -p ${args.ssh_port} -i ${privateKeyPath} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR'
;
}
[email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
is it possible to use rsync with password ?
Bug Description
A clear and concise description of what the bug is.
My Action Config
on:
push:
# !!!!!!! TODO Fill Out !!!!!!!
My Action Log
# Paste Log here
Bug Description
When I open my workflow file than there is linting error, displaying, that there is a missing required input, although the source-path
shouldn't be required
My Action Config
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
# push:
# branches: ["main"]
# pull_request:
# branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
web-deploy:
name: ๐ SSH-Deploy
runs-on: ubuntu-latest
steps:
- name: ๐ Get latest code
uses: actions/checkout@v3
- name: ๐ป Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: ๐ฅ Install dependencies
run: npm ci
- name: ๐จ Build Project
run: npm run production
- name: ๐ Sync files
# https://github.com/SamKirkland/web-deploy
uses: SamKirkland/web-deploy@v1
with:
target-server: ${{ secrets.SSH_SERVER }}
remote-user: ${{ secrets.SSH_USERNAME }}
private-ssh-key: ${{ secrets.SSH_KEY }}
ssh-port: 22
destination-path: ./www/public_html/
rsync-options: >
--dry-run
--archive
--verbose
--compress
--delete-after
--human-readable
--exclude-from=.github/workflows/deploy/rsync-exclude.txt
Hi,
I'm using OpenSSH_8.9p1 Ubuntu-3ubuntu0.1, OpenSSL 3.0.2 15 Mar 2022
This version doesn't allow the usage of rsa keys (auth.log : userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth])
I can't provide an ED25519 key because it is clearly written in the specs it has to be a RSA key.
I tried allowing rsa temporarily to see if it works, unfortunately it didn't. Either way I wouldn't like to use something not secure enough. It would be better if there was a way to use ED25519 keys.
Is that possible somehow?
Thanks
The output of update main.yml:
Current runner version: '2.275.1'
Operating System
Ubuntu
18.04.5
LTS
Virtual Environment
Environment: ubuntu-18.04
Version: 20201210.0
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu18/20201210.0/images/linux/Ubuntu1804-README.md
Prepare workflow directory
Prepare all required actions
Getting action download info
Failed to resolve action download info. Error: Unable to resolve action SamKirkland/[email protected]
, unable to find version 1.0.0
Retrying in 24.817 seconds
Failed to resolve action download info. Error: Unable to resolve action SamKirkland/[email protected]
, unable to find version 1.0.0
Retrying in 12.956 seconds
Error: Failed to resolve action download info.
Content of my main.yaml:
on: push
name: Publish Website
jobs:
web-deploy:
name: ๐ Deploy website every commit
runs-on: ubuntu-latest
steps:
- name: ๐ Get latest code
uses: actions/[email protected]
- name: ๐ Sync files
uses: SamKirkland/[email protected]
with:
target-server: sftp.beautique-in.nl
remote-user: 346741
remote-key: ${{ secrets.ftp_password }}
rsync-options: --dry-run --insecure
Dear Sam Kirkland and/or collaborators,
suggestion/feature request:
When calculating diff betwen local and server, if I renamed a file from:
fileFavorite.ext
to :
fileFAVORITE.ext
the action currently does not recognize the change and leaves the previous file (fileFavorite.ext).
โ this file was renamed to clientesTABLA.php but this did not recognize the change
It would be great if by default it is not case sensitive (as I think it is right now), and and option to make it case sensitive, so in my case when deploying the first file would be overwritten with the new file.
Thank you for studying this suggestion.
I am very grateful for your effort and this GitHub Action.
best regards
Josepe
Bug Description
A clear and concise description of what the bug is.
My Action Config
on: push
name: Publish Website Dry Run
jobs:
web-deploy:
name: ๐ Deploy Website Every Commit
runs-on: ubuntu-latest
if: ${{ contains(github.event.head_commit.message, '#prod') }}
steps:
- name: ๐ Get Latest Code
uses: actions/checkout@v3
- name: ๐ Sync Files
uses: SamKirkland/web-deploy@v1
with:
target-server: #######pl
remote-user: ##########
private-ssh-key: ${{ secrets.SSH_DEV }}
ssh-port: 22
destination-path: ~/public_html/schody/
rsync-options: --dry-run --archive --verbose --compress --delete-after --human-readable --exclude=.git* --exclude=.git/ --exclude=README.md --exclude=readme.md --exclude=.gitignore
My Action Log
Run SamKirkland/web-deploy@v1
----------------------------------------------------------------
๐ Thanks for using web deploy. Let's deploy some stuff!
----------------------------------------------------------------
If you found this project helpful, please support it
by giving it a โญ on Github --> https://github.com/SamKirkland/web-deploy
or add a badge ๐ท๏ธ to your projects readme --> https://github.com/SamKirkland/web-deploy#badge
----------------------------------------------------------------
HOME /home/runner
GITHUB_WORKSPACE /home/runner/work/schody/schody
[SSH] Creating /home/runner/.ssh/known_hosts file in /home/runner/work/schody/schody
โ
[SSH] file created.
โ
Ssh key added to `.ssh` dir /home/runner/.ssh/web_deploy_key
/usr/bin/rsync -e ssh -p 22 -i /home/runner/.ssh/web_deploy_key -o StrictHostKeyChecking=no --dry-run --archive --verbose --compress --delete-after --human-readable --exclude=.git* --exclude=.git/ --exclude=README.md --exclude=readme.md --exclude=.gitignore ./ [email protected]:~/public_html/schody/
<Buffer 57 61 72 6e 69 6e 67 3a 20 50 65 72 6d 61 6e 65 6e 74 6c 79 20 61 64 64 65 64 20 27 61 6c 6c 73 65 6e 73 65 73 2e 70 6c 2c 39 34 2e 31 35 32 2e 31 38 ... 44 more bytes>
Warning: Permanently added 'allsenses.pl,94.152.181.235' (ECDSA) to the list of known hosts.
<Buffer 4c 6f 61 64 20 6b 65 79 20 22 2f 68 6f 6d 65 2f 72 75 6e 6e 65 72 2f 2e 73 73 68 2f 77 65 62 5f 64 65 70 6c 6f 79 5f 6b 65 79 22 3a 20 69 6e 76 61 6c ... [11](https://github.com/allsensesdev/schody/actions/runs/3330115080/jobs/5508178259#step:3:12) more bytes>
Load key "/home/runner/.ssh/web_deploy_key": invalid format
<Buffer 61 6c 6c 73 65 6e 73 65 73 64 65 76 40 61 6c 6c 73 65 6e 73 65 73 2e 70 6c 3a [20](https://github.com/allsensesdev/schody/actions/runs/3330115080/jobs/5508178259#step:3:21) 50 65 72 6d 69 73 73 69 6f 6e 20 64 65 6e 69 65 64 20 28 70 75 62 6c ... 30 more bytes>
[email protected]: Permission denied (publickey,keyboard-interactive).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
<Buffer 72 73 79 6e 63 3a 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 75 6e 65 78 70 65 63 74 65 64 6c 79 20 63 6c 6f 73 65 64 20 28 30 20 62 79 74 65 73 20 72 65 63 ... 93 more bytes>
rsync error: unexplained error (code 255) at io.c([23](https://github.com/allsensesdev/schody/actions/runs/3330115080/jobs/5508178259#step:3:24)5) [sender=3.1.3]
Error: Error: The process '/usr/bin/rsync' failed with exit code [25](https://github.com/allsensesdev/schody/actions/runs/3330115080/jobs/5508178259#step:3:26)5
โ
Deploy Complete
Bug Description
I have tried several different attempts at generating SSH keys (both via github and from cpanel), both fail to connect via web-deploy action. When I try it from my local PC to connect, it's totally fine and authenticates. I have also added the public SSH key to github.
My Action Config
on:
push:
branches:
- dev
name: Publish Dev Branch to CPanel
jobs:
web-deploy:
name: ๐ Deploy Website to Dev
runs-on: ubuntu-latest
steps:
- name: ๐ Get Latest Code
uses: actions/checkout@v3
- name: ๐ฆ Install Packages
uses: actions/setup-node@v3
with:
node-version: 16
cache: "npm"
- run: npm ci
- name: ๐จ Build
run: npm run build
- name: ๐ Sync Files
uses: SamKirkland/web-deploy@v1
with:
target-server: ############
remote-user: ######
private-ssh-key: ${{ secrets.SSH_KEY }}
destination-path: ~/home/###/###/repositories/####/
ssh-port: 722
My Action Log
Run SamKirkland/web-deploy@v1
----------------------------------------------------------------
๐ Thanks for using web deploy. Let's deploy some stuff!
----------------------------------------------------------------
If you found this project helpful, please support it
by giving it a โญ on Github --> https://github.com/SamKirkland/web-deploy
or add a badge ๐ท๏ธ to your projects readme --> https://github.com/SamKirkland/web-deploy#badge
----------------------------------------------------------------
HOME /home/runner
GITHUB_WORKSPACE /home/runner/work/###/
[SSH] Creating /home/runner/.ssh/known_hosts file in /home/runner/work/kitt-front/kitt-front
โ
[SSH] file created.
โ
Ssh key added to `.ssh` dir /home/runner/.ssh/web_deploy_key
/usr/bin/rsync -e ssh -p 722 -i /home/runner/.ssh/web_deploy_key -o StrictHostKeyChecking=no --archive --verbose --compress --human-readable --progress --delete-after --exclude=.git* --exclude=.git/ --exclude=README.md --exclude=readme.md --exclude=.gitignore ./ #####@#####:~/home/#####/#####/####/#####/
<Buffer 57 61 72 6e 6[9](https://github.com/####/#####/actions/runs/4136808053/jobs/7151168830#step:6:10) 6e 67 3a 20 50 65 72 6d 61 6e 65 6e 74 6c 79 20 61 64 64 65 64 20 27 5b 66 65 72 67 75 73 2d 6c 6f 6e 32 2e 6b 72 79 73 74 61 6c 2e 75 ... 47 more bytes>
Warning: Permanently added '[####]:722' (ED25519) to the list of known hosts.
<Buffer 4c 6f 61 64 20 6b 65 79 20 22 2f 68 6f 6d 65 2f 72 75 6e 6e 65 72 2f 2e 73 73 68 2f 77 65 62 5f 64 65 70 6c 6f 79 5f 6b 65 79 22 3a 20 65 72 72 6f 72 ... [15](https://github.com/###/##/actions/runs/4136808053/jobs/7151168830#step:6:16) more bytes>
Load key "/home/runner/.ssh/web_deploy_key": error in libcrypto
<Buffer 50 65 72 6d 69 73 73 69 6f 6e [20](https://github.com/#####/####/actions/runs/4136808053/jobs/7151168830#step:6:21) 64 65 6e 69 65 64 2c 20 70 6c 65 61 73 65 20 74 72 79 20 61 67 61 69 6e 2e 0d 0a>
Permission denied, please try again.
<Buffer 50 65 72 6d 69 73 73 69 6f 6e 20 64 65 6e 69 65 64 2c 20 70 6c 65 61 73 65 20 74 72 79 20 61 67 61 69 6e 2e 0d 0a>
Permission denied, please try again.
<Buffer 6b 69 74 74 6d 65 64 69 40 66 65 72 67 75 73 2d 6c 6f 6e 32 2e 6b 72 79 73 74 61 6c 2e 75 6b 3a 20 50 65 72 6d 69 73 73 69 6f 6e 20 64 65 6e 69 65 64 ... 24 more bytes>
<Buffer 72 73 79 6e 63 3a 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 75 6e 65 78 70 65 63 74 65 64 6c 79 20 63 6c 6f 73 65 64 20 28 30 20 62 79 74 65 73 20 72 65 63 ... 93 more bytes>
#####@fergus-lon2.krystal.uk: Permission denied (publickey,password).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c([22](https://github.com/####/####/actions/runs/4136808053/jobs/7151168830#step:6:23)8) [sender=3.2.3]
Error: Error: The process '/usr/bin/rsync' failed with exit code [25](https://github.com/####/###/actions/runs/4136808053/jobs/7151168830#step:6:26)5
โ
Deploy Complete
Hello!
If there any way to add the password field to the component, because my ISP provider provides only ssh ftp access with a username and password?
Thank you.
Bug Description
Whenever I run the web-deploy action in my server, all files and folders that does not exist in the git repo are automatically deleted from the server.
For example, I have a file .env
and this file is not included in the github repo, but whenever I run the deploy script, it is automatically deleted from the server. Same goes for folders which are created manually in the server.
My Action Config
on:
push:
branches:
- production
name: ๐ Deploy files to the production server on push to production branch
jobs:
deploy:
name: ๐ Deploy files
runs-on: ubuntu-latest
steps:
- name: ๐ Get latest code
uses: actions/checkout@v4
- name: Setup PHP ๐
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- name: Cache Composer Packages ๐ฆ
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install Dependencies ๐จโ๐ฉโ๐งโ๐ฆ
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
- name: ๐ Sync files
uses: SamKirkland/web-deploy@v1
with:
target-server: example.com
remote-user: ${{ secrets.do_sftp_username }}
private-ssh-key: ${{ secrets.do_application_ssh_key }}
destination-path: ~/public_html/
source-path: ./
ssh-port: 22
rsync-options: --archive --verbose --compress --delete-after --human-readable --exclude=.git* --exclude=.git/ --exclude=README.md --exclude=readme.md --exclude=.gitignore --exclude "misc/" --exclude "src/" --exclude "*.txt"
What could be the problem?
I have seen that this rsync process always performs a complete full sync. Is there a way to say that only the changes from the latest commits are deployed?
Bug Description
I have stored the ss_key as a secret. When its copied to the file, I get the following error:
Permissions for 'D:\a\_actions\SamKirkland\web-deploy\v1\dist\.ssh\web_deploy_key' are too open.
My Action Config
deploy:
runs-on: windows-latest
needs: build
steps:
- name: Install Rsync
run: choco install rsync
- name: Rsync version
run: gh version
- name: webDeploy
uses: SamKirkland/web-deploy@v1
with:
target-server: *******
remote-user: **********
private-ssh-key: ${{ secrets.SSH_KEY }}
destination-path: ~/GitActionTest/
My Action Log
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
<Buffer 40 20 20 20 20 20 20 20 20 20 57 41 52 4e 49 4e 47 3a 20 55 4e 50 52 4f 54 45 43 54 45 44 20 50 52 49 56 41 54 45 20 4b 45 59 20 46 49 4c 45 21 20 20 ... 72 more bytes>
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
<Buffer 50 65 72 6d 69 73 73 69 6f 6e 73 20 66 6f 72 20 27 44 3a 5c 5c 61 5c 5c 5f 61 63 74 69 6f 6e 73 5c 5c 53 61 6d 4b 69 72 6b 6c 61 6e 64 5c 5c 77 65 62 ... 56 more bytes>
Permissions for 'D:\\a\\_actions\\SamKirkland\\web-deploy\\v1\\dist\\.ssh\\web_deploy_key' are too open.
<Buffer 49 74 20 69 73 20 72 65 71 75 69 72 65 64 20 74 68 61 74 20 79 6f 75 72 20 70 72 69 76 61 74 65 20 6b 65 79 20 66 69 6c 65 73 20 61 72 65 20 4e 4f 54 ... 24 more bytes>
It is required that your private key files are NOT accessible by others.
<Buffer 54 68 69 73 20 70 72 69 76 61 74 65 20 6b 65 79 20 77 69 6c 6c 20 62 65 20 69 67 6e 6f 72 65 64 2e 0d 0a>
This private key will be ignored.
<Buffer 4c 6f 61 64 20 6b 65 79 20 22 44 3a 5c 5c 61 5c 5c 5f 61 63 74 69 6f 6e 73 5c 5c 53 61 6d 4b 69 72 6b 6c 61 6e 64 5c 5c 77 65 62 2d 64 65 70 6c 6f 79 ... 52 more bytes>
Load key "D:\\a\\_actions\\SamKirkland\\web-deploy\\v1\\dist\\.ssh\\web_deploy_key": bad permissions
************************: Permission denied (publickey,keyboard-interactive).
<Buffer 72 73 79 6e 63 3a 20 5b 73 65 6e 64 65 72 5d 20 73 61 66 65 5f 72 65 61 64 20 66 61 69 6c 65 64 20 74 6f 20 72 65 61 64 20 [34](***************/job/18949547901#step:4:35) 20 62 79 74 65 73 3a 20 ... 31 more bytes>
rsync: [sender] safe_read failed to read 4 bytes: Connection reset by peer (104)
<Buffer 72 73 79 6e 63 20 65 72 72 6f 72 3a 20 65 72 72 6f 72 20 69 6e 20 72 73 79 6e 63 20 70 72 6f 74 6f 63 6f 6c 20 64 61 74 61 20 73 74 72 65 61 6d 20 28 ... [37](https://github.com/****************/actions/runs/6963609545/job/18949547901#step:4:38) more bytes>
rsync error: error in rsync protocol data stream (code 12) at io.c(282) [sender=3.2.7]
Error: Error: The process 'C:\ProgramData\Chocolatey\bin\rsync.exe' failed with exit code 12
I'm using LAMP Packages by bitnami on a vps and it seems on every push, the Apache PHP can no longer write or create files on VPS unless I run everytime
- sudo chown -R bitnami:daemon /opt/bitnami/apache/htdocs
- sudo chmod -R g+w /opt/bitnami/apache/htdocs
My Action Config
on:
push:
- name: ๐ Sync Files
uses: SamKirkland/web-deploy@v1
with:
target-server: ${{ secrets.server}}
remote-user: ${{ secrets.user}}
private-ssh-key: ${{ secrets.SSH_KEY }}
ssh-port: ${{ secrets.port}}
destination-path: ~/core/
rsync-options: --delete-after --human-readable --exclude=.git* --exclude=.git/ --exclude=README.md --exclude=readme.md --exclude=.gitignore --exclude=public/uploads/*
It works when uploading to the server but rsync removes the folders vendor and .env how can these 2 things not be deleted on the server?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.