mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-29 13:15:42 +00:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b76b6852c3 | ||
|
|
4aba730b93 | ||
|
|
6153c9d0af |
@@ -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 ==="
|
||||
|
||||
Reference in New Issue
Block a user