Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
[![Workflow Release](https://img.shields.io/github/actions/workflow/status/cssnr/stack-deploy-action/release.yaml?logo=github&label=release)](https://github.com/cssnr/stack-deploy-action/actions/workflows/release.yaml)
[![Workflow Test](https://img.shields.io/github/actions/workflow/status/cssnr/stack-deploy-action/test.yaml?logo=github&label=test)](https://github.com/cssnr/stack-deploy-action/actions/workflows/test.yaml)
[![Workflow Lint](https://img.shields.io/github/actions/workflow/status/cssnr/stack-deploy-action/lint.yaml?logo=github&label=lint)](https://github.com/cssnr/stack-deploy-action/actions/workflows/lint.yaml)
[![GitHub Last Commit](https://img.shields.io/github/last-commit/cssnr/stack-deploy-action?logo=github&label=updated)](https://github.com/cssnr/stack-deploy-action/graphs/commit-activity)
[![GitHub Last Commit](https://img.shields.io/github/last-commit/cssnr/stack-deploy-action?logo=github&label=updated)](https://github.com/cssnr/stack-deploy-action/pulse)
[![Codeberg Last Commit](https://img.shields.io/gitea/last-commit/cssnr/stack-deploy-action/master?gitea_url=https%3A%2F%2Fcodeberg.org%2F&logo=codeberg&logoColor=white&label=updated)](https://codeberg.org/cssnr/stack-deploy-action)
[![GitHub Contributors](https://img.shields.io/github/contributors/cssnr/stack-deploy-action)](https://github.com/cssnr/stack-deploy-action/graphs/contributors)
[![GitHub Repo Size](https://img.shields.io/github/repo-size/cssnr/stack-deploy-action?logo=bookstack&logoColor=white&label=size)](https://github.com/cssnr/stack-deploy-action)
[![GitHub Top Language](https://img.shields.io/github/languages/top/cssnr/stack-deploy-action?logo=sharp&logoColor=white)](https://github.com/cssnr/stack-deploy-action)
[![GitHub repo size](https://img.shields.io/github/repo-size/cssnr/stack-deploy-action?logo=bookstack&logoColor=white&label=size)](https://github.com/cssnr/stack-deploy-action)
[![GitHub Discussions](https://img.shields.io/github/discussions/cssnr/stack-deploy-action)](https://github.com/cssnr/stack-deploy-action/discussions)
[![GitHub Discussions](https://img.shields.io/github/discussions/cssnr/stack-deploy-action?logo=github)](https://github.com/cssnr/stack-deploy-action/discussions)
[![GitHub Forks](https://img.shields.io/github/forks/cssnr/stack-deploy-action?style=flat&logo=github)](https://github.com/cssnr/stack-deploy-action/forks)
[![GitHub Repo Stars](https://img.shields.io/github/stars/cssnr/stack-deploy-action?style=flat&logo=github)](https://github.com/cssnr/stack-deploy-action/stargazers)
[![GitHub Org Stars](https://img.shields.io/github/stars/cssnr?style=flat&logo=github&label=org%20stars)](https://cssnr.github.io/)
[![Discord](https://img.shields.io/discord/899171661457293343?logo=discord&logoColor=white&label=discord&color=7289da)](https://discord.gg/wXy6m2X8wY)
[![Support](https://img.shields.io/badge/Ko--fi-579fbf?logo=kofi&label=Support)](https://ko-fi.com/cssnr)
[![Ko-fi](https://img.shields.io/badge/Ko--fi-72a5f2?logo=kofi&label=support)](https://ko-fi.com/cssnr)

# Docker Stack Deploy Action

Expand Down Expand Up @@ -54,6 +55,7 @@ For more details see [action.yaml](action.yaml) and [src/main.sh](src/main.sh).
| `user` | **Yes** | - | Remote Docker Username |
| `pass` | or `ssh_key` | - | Remote Docker Password \* |
| `ssh_key` | or `pass` | - | Remote SSH Key File \* |
| `disable_keyscan` | - | `false` | Disable SSH Key Scan: `ssh-keyscan` \* |
| `env_file` | - | - | Docker Environment File \* |
| `detach`**²** | - | `true` | Detach Flag, `false`, to disable \* |
| `prune`**²** | - | `false` | Prune Flag, `true`, to enable |
Expand Down Expand Up @@ -96,6 +98,8 @@ If your hostname is behind a proxy like Cloudflare you will need to use the IP a

**pass/ssh_key:** You must provide either a `pass` or `ssh_key`, not both.

**disable_keyscan:** This will disable the `ssh-keyscan` command. Advanced use only.

**env_file:** Variables in this file are exported before running stack deploy.
To use a docker `env_file` specify it in your compose file and make it available in a previous step.
If you need compose file templating this can also be done in a previous step.
Expand Down Expand Up @@ -502,12 +506,12 @@ For more information, see the CSSNR [SUPPORT.md](https://github.com/cssnr/.githu

# Contributing

If you would like to submit a PR, please review the [CONTRIBUTING.md](CONTRIBUTING.md).

Please consider making a donation to support the development of this project
and [additional](https://cssnr.com/) open source projects.

[![Support](https://img.shields.io/badge/Ko--fi-579fbf?style=for-the-badge&logo=kofi&label=Support)](https://ko-fi.com/cssnr)

If you would like to submit a PR, please review the [CONTRIBUTING.md](CONTRIBUTING.md).
[![Ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/cssnr)

Additionally, you can support other GitHub Actions I have published:

Expand All @@ -524,4 +528,4 @@ Additionally, you can support other GitHub Actions I have published:
- [Package Changelog Action](https://github.com/cssnr/package-changelog-action?tab=readme-ov-file#readme)
- [NPM Outdated Check Action](https://github.com/cssnr/npm-outdated-action?tab=readme-ov-file#readme)

For a full list of current projects to support visit: [https://cssnr.github.io/](https://cssnr.github.io/)
For a full list of current projects visit: [https://cssnr.github.io/](https://cssnr.github.io/)
3 changes: 3 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ inputs:
ssh_key:
description: "Remote SSH Key File"
required: false
disable_keyscan:
description: "Disable SSH Key Scan"
required: false
env_file:
description: "Environment File"
required: false
Expand Down
8 changes: 6 additions & 2 deletions src/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

set -e

# shellcheck disable=SC2317
# shellcheck disable=SC2317,SC2329
function cleanup_trap() {
_ST="$?"
if [[ -z "${INPUT_SSH_KEY}" ]];then
Expand Down Expand Up @@ -59,7 +59,11 @@ echo "Deploy Mode: ${INPUT_MODE}"

mkdir -p "${SSH_DIR}" ~/.ssh
chmod 0700 "${SSH_DIR}" ~/.ssh
ssh-keyscan -p "${INPUT_PORT}" -H "${INPUT_HOST}" >> "${SSH_DIR}/known_hosts"

if [[ "${INPUT_DISABLE_KEYSCAN}" != "true" ]];then
echo "Running: ssh-keyscan"
ssh-keyscan -p "${INPUT_PORT}" -H "${INPUT_HOST}" >> "${SSH_DIR}/known_hosts"
fi
echo "::endgroup::"

## Setup Authentication
Expand Down
Loading