2 Commits

Author SHA1 Message Date
adlee-was-taken
52d7118c33 Add favicon and prod deploy script
All checks were successful
Build & Deploy Staging / build-and-deploy (release) Successful in 1m23s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 20:37:36 -04:00
adlee-was-taken
d7631ec671 Fix CI: remove checkout step, runner can't resolve gitea hostname
All checks were successful
Build & Deploy Staging / build-and-deploy (release) Successful in 1m27s
The build happens on the staging server via SSH, not in the runner
container, so checkout is unnecessary.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 19:51:54 -04:00
3 changed files with 43 additions and 2 deletions

View File

@@ -8,8 +8,6 @@ jobs:
build-and-deploy: build-and-deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4
- name: Build, push, and deploy to staging - name: Build, push, and deploy to staging
uses: appleboy/ssh-action@v1 uses: appleboy/ssh-action@v1
with: with:

View File

@@ -4,6 +4,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>Golf Card Game</title> <title>Golf Card Game</title>
<link rel="icon" type="image/svg+xml" href="golfball-logo.svg">
<link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="style.css">
</head> </head>
<body> <body>

42
scripts/deploy-prod.sh Executable file
View File

@@ -0,0 +1,42 @@
#!/bin/bash
set -e
TAG="${1:?Usage: deploy-prod.sh <tag> (e.g. v3.3.2)}"
DROPLET="root@165.245.152.51"
IMAGE="git.adlee.work/alee/golfgame"
echo "Deploying $TAG to production ($DROPLET)..."
ssh $DROPLET bash -s "$TAG" "$IMAGE" <<'REMOTE'
set -e
TAG="$1"
IMAGE="$2"
cd /opt/golfgame
# Pull the image that passed staging
docker pull "$IMAGE:$TAG"
docker tag "$IMAGE:$TAG" golfgame-app:latest
# Update code for compose/env changes
git fetch origin
git checkout "$TAG"
# Restart app
docker compose -f docker-compose.prod.yml up -d app
# Wait for healthy
echo "Waiting for health check..."
for i in $(seq 1 30); do
if docker compose -f docker-compose.prod.yml ps app | grep -q "healthy"; then
echo "Production deploy successful — $TAG"
exit 0
fi
sleep 2
done
echo "CRITICAL: app not healthy after 60s"
docker compose -f docker-compose.prod.yml logs --tail=30 app
exit 1
REMOTE
echo "Done."