serversideup / github-action-docker-swarm-deploy

GNU General Public License v3.0
12 stars 2 forks source link

Error in Docker Swarm Deployment Action: "docker stack deploy" requires exactly 1 argument #2

Open ajay-er opened 1 month ago

ajay-er commented 1 month ago

I am encountering an error while trying to deploy my Docker stack using the serversideup/github-action-docker-swarm-deploy@v1 GitHub Action. The deployment process fails with the following error message:

Run docker --log-level debug -H ssh://***@***:22 \
time="2024-07-20T09:53:37Z" level=debug msg="commandconn: starting ssh with [-o ConnectTimeout=30 -l *** -p 22 -- *** docker system dial-stdio]"
"docker stack deploy" requires exactly 1 argument.
See 'docker stack deploy --help'.

Usage:  docker stack deploy [OPTIONS] STACK

deploy step

  deploy:
    runs-on: ubuntu-latest
    needs: build-and-push-image
    steps:
      - name: docker-swarm-deploy-github-action
        uses: serversideup/github-action-docker-swarm-deploy@v1
        with:
          docker_compose_file_path: "compose.yml"
          stack_name: "skillclub"
          deployment_ssh_private_key:  ${{ secrets.REMOTE_PRIVATE_KEY }}
          remote_ssh_known_hosts: ${{ secrets.REMOTE_PUBLIC_KEY }}
          remote_ssh_deployment_user: ${{ secrets.REMOTE_USER }}
          remote_ssh_server_hostname: ${{ secrets.REMOTE_HOST }}
          registry: "ghcr.io"
          registry-username: ${{ secrets.GHCR_USERNAME }}
          registry-token: ${{ secrets.GHCR_TOKEN }}

It appears that the action is not passing the required argument to the docker stack deploy command. This argument should be the stack name, which is defined as skillclub in my workflow. thanks

coolio85 commented 1 month ago

Hey,

I believe your issue is with your compose file path, it should be -c compose.yml

ajay-er commented 1 month ago

Thanks for your reply. The compose file issue is resolved, but now I'm encountering a new error during deployment:

open /home/runner/work/skillclub-backend/skillclub-backend/.env: no such file or directory

How can I resolve this new .env issue when deploying to Docker Swarm using this GitHub Action?

coolio85 commented 1 month ago

What does your build step look like? Are you able to provide your compose.yml as well?