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
30 changes: 0 additions & 30 deletions .github/dependabot.yml

This file was deleted.

8 changes: 5 additions & 3 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ jobs:
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
persist-credentials: false

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version-file: .node-version
cache: npm
Expand Down Expand Up @@ -66,7 +68,7 @@ jobs:
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
name: Upload Artifact
id: upload
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: dist
path: dist/
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ jobs:
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
persist-credentials: false

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version-file: .node-version
cache: npm
Expand Down Expand Up @@ -55,7 +57,9 @@ jobs:
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
persist-credentials: false

- name: Test Stack Deploy (Swarmpit)
id: test-deploy-swarmpit
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,21 @@ jobs:
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
persist-credentials: false

- name: Initialize CodeQL
id: initialize
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@fb84f6228fd846d3c392887f22b18ce2d9139495 # v4
with:
languages: ${{ matrix.language }}
source-root: src

- name: Autobuild
id: autobuild
uses: github/codeql-action/autobuild@v3
uses: github/codeql-action/autobuild@fb84f6228fd846d3c392887f22b18ce2d9139495 # v4

- name: Perform CodeQL Analysis
id: analyze
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@fb84f6228fd846d3c392887f22b18ce2d9139495 # v4
14 changes: 11 additions & 3 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ jobs:
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
fetch-depth: 0
persist-credentials: false

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version-file: .node-version
cache: npm
Expand All @@ -38,7 +39,7 @@ jobs:

- name: Lint Codebase
id: super-linter
uses: super-linter/super-linter/slim@v7
uses: super-linter/super-linter/slim@729e0f967409dceb0a898cdd94a5534719f85c36 # v8
env:
DEFAULT_BRANCH: main
FILTER_REGEX_EXCLUDE: dist/**/*
Expand All @@ -52,4 +53,11 @@ jobs:
VALIDATE_JSON: false
VALIDATE_TYPESCRIPT_STANDARD: false
VALIDATE_GIT_COMMITLINT: false
VALIDATE_CHECKOV: false
VALIDATE_JAVASCRIPT_BIOME: false
VALIDATE_TYPESCRIPT_BIOME: false
VALIDATE_JSON_BIOME: false
VALIDATE_BIOME_FORMAT: false
VALIDATE_BIOME_LINT: false
VALIDATE_GITHUB_ACTIONS_ZIZMOR: false
GITHUB_ACTIONS_CONFIG_FILE: .actionlint.yml
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.9.0
24.18.0
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,36 @@
[![CodeQL](https://github.com/spawnlab-dev/stack-deploy-action/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/spawnlab-dev/stack-deploy-action/actions/workflows/codeql-analysis.yml)
[![Coverage](./badges/coverage.svg)](./badges/coverage.svg)

Manage docker swarm stacks using various client API e.g
Manage Docker swarm stacks using various client API e.g
[SwarmpIt](https://swarmpit.io/), [Portainer](https://www.portainer.io/) without
needing of exposing docker manager node over SSH.
needing of exposing Docker manager node over SSH.

## Supported Client's

| Client | Status | Supported Actions | Notes |
| ------------------------------------- | ------ | --------------------------- | ----------------------------------------------------- |
| Client | Status | Supported Actions | Notes |
| ------------------------------------- | ------ | ------------------------- | ----------------------------------------------------- |
| [SwarmpIt](https://swarmpit.io/) | ✅ | [✔] deploy<br> [✔] delete | |
| [Portainer](https://www.portainer.io) | ✅ | [✔] deploy<br> [✔] delete | refer the [setup guide](#how-to-use-portainer-client) |

### How to use `Portainer` client

Since portainer support multi installations i.e. local, remote, and different
types e.g. k8s, docker compose, swarm etc, So in-order to use the `portainer`
types e.g. k8s, Docker compose, swarm etc, So in-order to use the `portainer`
client you need to pass the `swarmId` & `endPointId`. Please follow the below
steps/docs to find both required value.

- To find the `swarmId` i.e. docker cluster ID, please run the below command in
docker manager node
- To find the `swarmId` i.e. Docker cluster ID, please run the below command in
Docker manager node

```shell
$ docker info | grep "Cluster"
$ Docker info | grep "Cluster"
ClusterID: mtoqjoa2xxvXXXrw
```

Use value `mtoqjoa2xxvXXXrw` as "swarmId"

- To find the `endPointId` follow this guide:
[here](https://tinyurl.com/yc7m7y5v)
- To find the `endPointId` follow the
[Portainer endpoint ID guide](https://tinyurl.com/yc7m7y5v)

## Inputs

Expand Down
14 changes: 3 additions & 11 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,10 @@ inputs:
description: 'Docker swarm stack name'
required: true
client:
description: 'Choose on of the supported client'
type: choice
options:
- swarmpit
- portainer
description: 'Supported client: swarmpit or portainer'
required: true
action:
description: 'Choose deploy or delete'
type: choice
options:
- deploy
- delete
description: 'Action to perform: deploy or delete'
required: true
compose:
description: 'Docker compose file name ( only required for deploy )'
Expand All @@ -44,5 +36,5 @@ inputs:
required: false

runs:
using: node20
using: node24
main: dist/index.js
Loading