Skip to content

fix: skip SSH deploy gracefully when deployment secrets are not set - #4

Merged
mesayanroy merged 2 commits into
mainfrom
copilot/fix-deploy-to-production-failure
Mar 10, 2026
Merged

fix: skip SSH deploy gracefully when deployment secrets are not set#4
mesayanroy merged 2 commits into
mainfrom
copilot/fix-deploy-to-production-failure

Conversation

Copilot AI commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

The deploy-production job was failing after ~7s with Error: missing server host because appleboy/ssh-action was invoked unconditionally with unset secrets.

Changes

  • .github/workflows/deploy.yml: Added a Check deployment credentials step to deploy-production that gates the SSH deploy on the presence of DEPLOY_HOST, DEPLOY_USER, and DEPLOY_SSH_KEY — matching the existing pattern in push-docker-images for Docker credentials.
- name: Check deployment credentials
  id: creds
  run: |
    if [ -n "$DEPLOY_HOST" ] && [ -n "$DEPLOY_USER" ] && [ -n "$DEPLOY_SSH_KEY" ]; then
      echo "available=true" >> "$GITHUB_OUTPUT"
    else
      echo "available=false" >> "$GITHUB_OUTPUT"
      echo "::warning::DEPLOY_HOST, DEPLOY_USER, or DEPLOY_SSH_KEY secret is not set — skipping SSH deploy."
    fi

- name: SSH deploy
  if: steps.creds.outputs.available == 'true'
  uses: appleboy/ssh-action@v1.0.0
  ...

When secrets are absent the job emits a warning and succeeds; when configured, behaviour is unchanged.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…gured

Co-authored-by: mesayanroy <169074736+mesayanroy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix deploy to production failing after 7 seconds fix: skip SSH deploy gracefully when deployment secrets are not set Mar 10, 2026
@mesayanroy
mesayanroy marked this pull request as ready for review March 10, 2026 19:37
@mesayanroy
mesayanroy merged commit 9b08ebe into main Mar 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants