Skip to content

Commit 1aa464e

Browse files
committed
ci(deploy): free ssh-agent socket before the admin gh-pages deploy
The admin SPA deploy to smalruby.app/admin/ (EPIC #1073) runs a second peaceiris/actions-gh-pages in the same job. That action binds a fixed SSH_AUTH_SOCK (/tmp/ssh-auth.sock) when using deploy_key, and the main smalruby.app deploy above leaves its ssh-agent running, so the admin deploy failed with 'unix_listener: cannot bind to path /tmp/ssh-auth.sock: Address already in use'. Free the socket between the two deploys. Surfaced on the first develop run that included the admin deploy step (PR #1094 merge).
1 parent 70f0808 commit 1aa464e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,16 @@ jobs:
308308
full_commit_message: "Build for ${{ github.sha }} ${{ github.event.head_commit.message }}"
309309
cname: smalruby.app
310310
external_repository: smalruby/smalruby.app
311+
# peaceiris/actions-gh-pages binds a fixed SSH_AUTH_SOCK
312+
# (/tmp/ssh-auth.sock) when deploying with deploy_key. The main deploy
313+
# above leaves that ssh-agent running, so the second (admin) deploy
314+
# cannot rebind the socket and fails with "Address already in use".
315+
# Free it before the second deploy.
316+
- name: Free ssh-agent socket before the admin deploy
317+
if: github.ref == 'refs/heads/develop'
318+
run: |
319+
pkill ssh-agent || true
320+
rm -f /tmp/ssh-auth.sock
311321
# Admin SPA at smalruby.app/admin/ (EPIC #1073). Must run AFTER the
312322
# main deploy: that step replaces the gh-pages content, so the admin
313323
# subdirectory is re-published on every release (destination_dir +

0 commit comments

Comments
 (0)