mirror of
https://gitee.com/jiulinxiri/ssh-scp-deploy.git
synced 2026-03-12 12:52:55 +08:00
Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
874eec1e4c | ||
|
|
21d9038bb4 | ||
|
|
8399b8ccf9 | ||
|
|
4856a9a4e9 | ||
|
|
7d22a8aeeb | ||
|
|
839788b727 | ||
|
|
5a27574133 | ||
|
|
5473b2d02c | ||
|
|
7d6ed29410 | ||
|
|
d744479d59 | ||
|
|
b4eb8f8a33 | ||
|
|
3393f06782 | ||
|
|
0cdc30a56f | ||
|
|
e3f5136f75 | ||
|
|
5b2be75e1a | ||
|
|
0cb5842c53 | ||
|
|
ad4bb0c9e0 | ||
|
|
40de7fd0b7 | ||
|
|
a9a68bc8ee | ||
|
|
2d5fd18c0b | ||
|
|
1b7e36c773 | ||
|
|
f0079adc5b | ||
|
|
796ad8132d | ||
|
|
67587a1976 | ||
|
|
7635795846 | ||
|
|
560f02a415 | ||
|
|
2ab605adf3 | ||
|
|
138c2fb2ea | ||
|
|
891f661b1b | ||
|
|
e5ccb99140 | ||
|
|
2f78613c53 | ||
|
|
f705dfd43a | ||
|
|
c3ed5c67e7 |
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@@ -12,9 +12,9 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- uses: underscore69/ssh-scp-deploy@main
|
||||
- uses: marcodallasanta/ssh-scp-deploy@main
|
||||
with:
|
||||
local: "./"
|
||||
local: "CHANGELOG.md"
|
||||
remote: "~/"
|
||||
host: ${{secrets.HOST}}
|
||||
user: ${{secrets.USER}}
|
||||
|
||||
25
CHANGELOG.md
25
CHANGELOG.md
@@ -1,9 +1,34 @@
|
||||
# [Unreleased]
|
||||
|
||||
## [v1.0.4] - 2021-02-10
|
||||
|
||||
### Fixed
|
||||
- Issue #9 - Wrong if on password.
|
||||
|
||||
## [v1.0.3] - 2021-02-08
|
||||
|
||||
### Fixed
|
||||
- Hardcoded user "ubuntu" in scp.
|
||||
|
||||
## [v1.0.2] - 2020-12-21
|
||||
|
||||
### Fixed
|
||||
- Dockerfile used to copy just entrypoint.sh.
|
||||
|
||||
## [v1.0.1] - 2020-12-21
|
||||
|
||||
### Fixed
|
||||
- Dockerfile used to copy just entrypoint.sh.
|
||||
|
||||
## [v1.0.0] - 2020-12-18
|
||||
|
||||
### Added
|
||||
- First definition of the action.
|
||||
|
||||
|
||||
[unreleased]: https://github.com/marcodallasanta/ssh-scp-deploy/compare/main...development
|
||||
[v1.0.4]: https://github.com/underscore69/ssh-scp-deploy/tree/v1.0.4
|
||||
[v1.0.3]: https://github.com/underscore69/ssh-scp-deploy/tree/v1.0.3
|
||||
[v1.0.2]: https://github.com/underscore69/ssh-scp-deploy/tree/v1.0.2
|
||||
[v1.0.1]: https://github.com/underscore69/ssh-scp-deploy/tree/v1.0.1
|
||||
[v1.0.0]: https://github.com/underscore69/ssh-scp-deploy/tree/v1.0.0
|
||||
@@ -7,7 +7,6 @@ RUN apk update && \
|
||||
bash
|
||||
|
||||
COPY LICENSE README.md /
|
||||
COPY entrypoint.sh with_key.sh with_pass.sh /
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
4
LICENSE
4
LICENSE
@@ -1,7 +1,7 @@
|
||||
|
||||
The MIT License (MIT)
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 Marco Dalla Santa and contributors
|
||||
Copyright (c) 2020 Marco Dalla Santa
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
49
README.md
49
README.md
@@ -1,17 +1,37 @@
|
||||
<p align="center">
|
||||
<img src="resources/logo.png">
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://docs.github.com/en/actions/creating-actions/about-actions#types-of-actions"><img alt="Action type" src="https://img.shields.io/badge/Docker%20action-262b31?logo=docker&logoColor=2496ed"></a>
|
||||
<a href="LICENSE"><img alt="License" src="https://img.shields.io/github/license/marcodallasanta/ssh-scp-deploy"></a>
|
||||
<a href="https://github.com/marcodallasanta/ssh-scp-deploy/actions?query=workflow%3ATest"><img alt="Pipeline status" src="https://github.com/marcodallasanta/ssh-scp-deploy/workflows/Test/badge.svg"></a>
|
||||
</p>
|
||||
|
||||
# ssh-scp-deploy
|
||||
|
||||
[](https://docs.github.com/en/actions/creating-actions/about-actions#types-of-actions)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](./)
|
||||
## ❔ Why should I use this action?
|
||||
|
||||
This action provide an easy and higly customizable way to upload files via scp and execute a set of command via ssh before or/and after.
|
||||
Because this action provide an easy and higly customizable way to upload files via scp and execute a set of command via ssh before or/and after.
|
||||
I use this action to deploy my personal projects to remote server, restarting the needed services or to do a simple upload via scp.
|
||||
|
||||
## Supported runners
|
||||
## 🏃 Supported runners
|
||||
[](https://docs.github.com/en/actions/creating-actions/about-actions#docker-container-actions)
|
||||
|
||||
## Usage
|
||||
|
||||
## 👤 Author
|
||||
|
||||
**Marco Dalla Santa**
|
||||
|
||||
* Twitter: [@marcodallasanta](https://twitter.com/marcodallasanta)
|
||||
* Github: [@marcodallasanta](https://github.com/marcodallasanta)
|
||||
* LinkedIn: [@marcodallasanta](https://linkedin.com/in/marcodallasanta)
|
||||
* StackOverflow: [@marcodallasanta](https://stackoverflow.com/story/marcodallasanta)
|
||||
|
||||
|
||||
## ⚙️ Usage
|
||||
```yaml
|
||||
- uses: underscore69/ssh-scp-deploy@v1.0.0
|
||||
- uses: mdallasanta/ssh-scp-deploy@{version}
|
||||
with:
|
||||
local: './' # Local file path - REQUIRED false - DEFAULT ./
|
||||
remote: '~/' # Remote file path - REQUIRED false - DEFAULT ~/
|
||||
@@ -26,5 +46,18 @@ This action provide an easy and higly customizable way to upload files via scp a
|
||||
scp_options: -v # Flags to use during scp - REQUIRED false - DEFAULT ''
|
||||
```
|
||||
|
||||
## License
|
||||
## 🤝 Contributing
|
||||
|
||||
Contributions, issues and feature requests are welcome!
|
||||
|
||||
Feel free to check [issues page](https://github.com/mdallasanta/ssh-scp-deploy/issues).
|
||||
|
||||
## 🙏 Thanks
|
||||
|
||||
Thanks to [Raphaël Bussa](https://github.com/raphaelbussa) for help in testing.
|
||||
|
||||
## 📝 License
|
||||
|
||||
Copyright © 2020 [Marco Dalla Santa](https://github.com/marcoallasanta)
|
||||
|
||||
The source code, scripts and documentation in this project are released under the [MIT License](LICENSE)
|
||||
@@ -1,15 +1,17 @@
|
||||
#!/bin/bash
|
||||
PASSWORD=${INPUT_PASSWORD}
|
||||
KEY=${INPUT_KEY}
|
||||
if [ -z "$PRE_UPLOAD" and "$PASSWORD"]; then
|
||||
|
||||
PASSWORD=${INPUT_PASSWORD};
|
||||
KEY=${INPUT_KEY};
|
||||
|
||||
if [ -z "$KEY" ] && [ -z "$PASSWORD" ]; then
|
||||
echo "🔑 Please provide at least a key or a password...";
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
if [[ ! -z "$KEY" ]]; then
|
||||
if [[ -n "$KEY" ]]; then
|
||||
echo "🔑 Using key file...";
|
||||
. with_key.sh;
|
||||
source /with_key.sh;
|
||||
else
|
||||
echo "🔑 Using password...";
|
||||
. with_pass.sh;
|
||||
source /with_pass.sh;
|
||||
fi
|
||||
BIN
resources/logo.png
Normal file
BIN
resources/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
@@ -11,7 +11,7 @@ if [ ! -z "$PRE_UPLOAD" ]; then
|
||||
fi
|
||||
|
||||
echo "🚚 Uploading via scp..." &&
|
||||
scp ${INPUT_SSH_OPTIONS} ${INPUT_SCP_OPTIONS} -P "${INPUT_PORT}" -r ${INPUT_LOCAL} ubuntu@${INPUT_HOST}:"${INPUT_REMOTE}" &&
|
||||
scp ${INPUT_SSH_OPTIONS} ${INPUT_SCP_OPTIONS} -P "${INPUT_PORT}" -r ${INPUT_LOCAL} ${INPUT_USER}@${INPUT_HOST}:"${INPUT_REMOTE}" &&
|
||||
echo "🙌 Uploaded via scp";
|
||||
|
||||
POST_UPLOAD=${INPUT_POST_UPLOAD}
|
||||
|
||||
@@ -6,7 +6,7 @@ if [ ! -z "$PRE_UPLOAD" ]; then
|
||||
fi
|
||||
|
||||
echo "🚚 Uploading via scp..." &&
|
||||
sshpass -p ${PASSWORD} scp ${INPUT_SSH_OPTIONS} ${INPUT_SCP_OPTIONS} -P "${INPUT_PORT}" -r ${INPUT_LOCAL} ubuntu@${INPUT_HOST}:"${INPUT_REMOTE}" &&
|
||||
sshpass -p ${PASSWORD} scp ${INPUT_SSH_OPTIONS} ${INPUT_SCP_OPTIONS} -P "${INPUT_PORT}" -r ${INPUT_LOCAL} ${INPUT_USER}@${INPUT_HOST}:"${INPUT_REMOTE}" &&
|
||||
echo "🙌 Uploaded via scp";
|
||||
|
||||
POST_UPLOAD=${INPUT_POST_UPLOAD}
|
||||
|
||||
Reference in New Issue
Block a user