diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9151ae3..69fb43c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -41,7 +41,6 @@ jobs: - name: "1: Test Password" if: ${{ always() }} - id: test1 uses: ./ with: name: test_stack-deploy @@ -61,7 +60,6 @@ jobs: - name: "2: Test SSH and Auth" if: ${{ always() && !github.event.act }} - id: test2 uses: ./ with: name: test_stack-deploy @@ -76,7 +74,7 @@ jobs: summary: false - name: "Schedule Failure Notification" + if: ${{ always() && failure() && github.event_name == 'schedule' }} uses: sarisia/actions-status-discord@v1 - if: ${{ always() && github.event_name == 'schedule' && (steps.test1.outcome != 'success' || steps.test2.outcome != 'success') }} with: webhook: ${{ secrets.DISCORD_WEBHOOK }} diff --git a/README.md b/README.md index a89012f..7708060 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ [![Test](https://img.shields.io/github/actions/workflow/status/cssnr/stack-deploy-action/test.yaml?logo=github&logoColor=white&label=test)](https://github.com/cssnr/stack-deploy-action/actions/workflows/test.yaml) [![Lint](https://img.shields.io/github/actions/workflow/status/cssnr/stack-deploy-action/lint.yaml?logo=github&logoColor=white&label=lint)](https://github.com/cssnr/stack-deploy-action/actions/workflows/lint.yaml) [![GitHub Release Version](https://img.shields.io/github/v/release/cssnr/stack-deploy-action?logo=github)](https://github.com/cssnr/stack-deploy-action/releases/latest) -[![GitHub Last Commit](https://img.shields.io/github/last-commit/cssnr/parse-issue-form-action?logo=github&logoColor=white&label=updated)](https://github.com/cssnr/parse-issue-form-action/graphs/commit-activity) -[![Codeberg Last Commit](https://img.shields.io/gitea/last-commit/cssnr/parse-issue-form-action/master?gitea_url=https%3A%2F%2Fcodeberg.org%2F&logo=codeberg&logoColor=white&label=updated)](https://codeberg.org/cssnr/parse-issue-form-action) +[![GitHub Last Commit](https://img.shields.io/github/last-commit/cssnr/stack-deploy-action?logo=github&logoColor=white&label=updated)](https://github.com/cssnr/stack-deploy-action/graphs/commit-activity) +[![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 Top Language](https://img.shields.io/github/languages/top/cssnr/stack-deploy-action?logo=htmx&logoColor=white)](https://github.com/cssnr/stack-deploy-action) [![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&logoColor=white)](https://github.com/cssnr/stack-deploy-action/stargazers) @@ -26,8 +26,7 @@ For more details see [action.yaml](action.yaml) and [src/main.sh](src/main.sh). > [!NOTE] > Please submit a [Feature Request](https://github.com/cssnr/stack-deploy-action/discussions/categories/feature-requests) -> for new features or [Open an Issue](https://github.com/cssnr/stack-deploy-action/issues) -> if you find any bugs... +> for new features or [Open an Issue](https://github.com/cssnr/stack-deploy-action/issues) if you find any bugs. ## Inputs @@ -75,6 +74,9 @@ Updating service test-stack_alpine (id: ewi9ck5hcdmmvaj8ms0te4t8r) +To see a workflow run you can view a recent +[test.yaml run](https://github.com/cssnr/stack-deploy-action/actions/workflows/test.yaml) _(requires login)_. + ```yaml - name: 'Stack Deploy' uses: cssnr/stack-deploy-action@v1 diff --git a/src/main.sh b/src/main.sh index f71ed24..a2da17d 100644 --- a/src/main.sh +++ b/src/main.sh @@ -5,16 +5,15 @@ set -e function cleanup_trap() { _ST="$?" - if [[ "${_ST}" != "0" ]]; then - echo -e "โ›” \u001b[31;1mFailed to deploy stack ${INPUT_NAME}" - echo "::error::Failed to deploy stack ${INPUT_NAME}. See logs for details..." - fi if [ -z "${INPUT_SSH_KEY}" ];then echo -e "๐Ÿงน Cleaning Up authorized_keys" ssh -o BatchMode=yes -o ConnectTimeout=30 -p "${INPUT_PORT}" "${INPUT_USER}@${INPUT_HOST}" \ "sed -i '/docker-stack-deploy-action/d' ~/.ssh/authorized_keys" fi - if [[ "${_ST}" == "0" ]]; then + if [[ "${_ST}" != "0" ]]; then + echo -e "โ›” \u001b[31;1mFailed to deploy stack ${INPUT_NAME}" + echo "::error::Failed to deploy stack ${INPUT_NAME}. See logs for details..." + else echo -e "โœ… \u001b[32;1mFinished Success" fi exit "${_ST}" diff --git a/src/summary.sh b/src/summary.sh index b9e1ba5..b07c281 100644 --- a/src/summary.sh +++ b/src/summary.sh @@ -14,4 +14,6 @@ ${STACK_RESULTS} [Report an issue or request a feature](https://github.com/cssnr/stack-deploy-action?tab=readme-ov-file#readme) + +--- EOM