Compare commits

...
Author SHA1 Message Date
admin b76b6852c3 Fix: Remove invalid protocol param, add explicit port 2026-01-08 21:00:02 -08:00
admin 4aba730b93 Use tcp6 protocol for IPv6 Hetzner connection 2026-01-08 20:44:41 -08:00
adminandClaude Opus 4.5 6153c9d0af Add CD step to deploy Shardok ARM64 to Hetzner
After building and pushing the ARM64 image, automatically deploy it to
the Hetzner server by SSHing in, pulling the new image, and restarting
the container.

Requires secrets: HETZNER_IP, HETZNER_SSH_KEY

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 20:41:12 -08:00
+50
View File
@@ -157,3 +157,53 @@ jobs:
echo "=== Push complete ==="
echo "Image: $IMAGE_TAG"
echo "Also tagged as: registry.digitalocean.com/eagle0/shardok-server:arm64-latest"
deploy-hetzner:
runs-on: ubuntu-latest
needs: [build-shardok-arm64]
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_images == 'true')
environment: production
env:
SHARDOK_IMAGE: ${{ needs.build-shardok-arm64.outputs.image_tag }}
steps:
- name: Deploy to Hetzner
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.HETZNER_IP }}
port: 22
username: deploy
key: ${{ secrets.HETZNER_SSH_KEY }}
script_stop: true
envs: SHARDOK_IMAGE
script: |
set -ex
cd /opt/eagle0
# Login to registry
echo "${{ secrets.DO_REGISTRY_TOKEN }}" | docker login registry.digitalocean.com -u "${{ secrets.DO_REGISTRY_TOKEN }}" --password-stdin
echo "Deploying Shardok ARM64: $SHARDOK_IMAGE"
# Pull the new image
docker pull "$SHARDOK_IMAGE"
# Stop and remove existing container
docker stop shardok-ai 2>/dev/null || true
docker rm shardok-ai 2>/dev/null || true
# Run new container
docker run -d \
--name shardok-ai \
--restart unless-stopped \
-p 40042:40042 \
-v /opt/eagle0/data:/data \
"$SHARDOK_IMAGE"
# Wait and verify
sleep 5
docker ps | grep shardok-ai
# Cleanup old images
docker image prune -f
echo "=== Hetzner deployment complete ==="