71 lines
2.2 KiB
YAML
71 lines
2.2 KiB
YAML
when:
|
|
- event: push
|
|
branch: main
|
|
- event: manual
|
|
|
|
steps:
|
|
notify-start:
|
|
image: node:24-bookworm
|
|
environment:
|
|
DEPLOY_TARGET_URL: http://bone-kingdom.tabitha.tealthrone/
|
|
DISCORD_DEPLOY_WEBHOOK_URL:
|
|
from_secret: discord_deploy_webhook_url
|
|
commands:
|
|
- sh scripts/woodpecker/notify-discord.sh started "Bone Kingdom Deploy Started" 5793266
|
|
|
|
validate:
|
|
image: node:24-bookworm
|
|
commands:
|
|
- npm ci
|
|
- npm run lint
|
|
- npm run test -- --runInBand
|
|
- npm run web:build
|
|
|
|
deploy:
|
|
image: node:24-bookworm
|
|
environment:
|
|
DEPLOY_TARGET_URL: http://bone-kingdom.tabitha.tealthrone/
|
|
DEPLOY_HOST: 100.108.87.106
|
|
DEPLOY_USER: Tabitha
|
|
DEPLOY_PATH: /Users/Tabitha/.openclaw/workspace_father/blb-throne-of-the-bone-king/dist/renderer
|
|
DEPLOY_SSH_PRIVATE_KEY:
|
|
from_secret: deploy_ssh_private_key
|
|
commands:
|
|
- apt-get update
|
|
- apt-get install -y --no-install-recommends openssh-client rsync
|
|
- test -d dist/renderer
|
|
- mkdir -p ~/.ssh
|
|
- printf '%s\n' "$DEPLOY_SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
|
|
- chmod 600 ~/.ssh/id_ed25519
|
|
- ssh-keyscan -H "$DEPLOY_HOST" >> ~/.ssh/known_hosts
|
|
- ssh "$DEPLOY_USER@$DEPLOY_HOST" "mkdir -p '$DEPLOY_PATH'"
|
|
- rsync -az --delete dist/renderer/ "$DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH/"
|
|
- curl -fsS "$DEPLOY_TARGET_URL" >/tmp/bone-kingdom-index.html
|
|
- grep -q '<div id="root">' /tmp/bone-kingdom-index.html
|
|
depends_on:
|
|
- validate
|
|
|
|
notify-success:
|
|
image: node:24-bookworm
|
|
environment:
|
|
DEPLOY_TARGET_URL: http://bone-kingdom.tabitha.tealthrone/
|
|
DISCORD_DEPLOY_WEBHOOK_URL:
|
|
from_secret: discord_deploy_webhook_url
|
|
commands:
|
|
- sh scripts/woodpecker/notify-discord.sh succeeded "Bone Kingdom Deploy Succeeded" 5763719
|
|
depends_on:
|
|
- deploy
|
|
when:
|
|
status: [success]
|
|
|
|
notify-failure:
|
|
image: node:24-bookworm
|
|
environment:
|
|
DEPLOY_TARGET_URL: http://bone-kingdom.tabitha.tealthrone/
|
|
DISCORD_DEPLOY_WEBHOOK_URL:
|
|
from_secret: discord_deploy_webhook_url
|
|
commands:
|
|
- sh scripts/woodpecker/notify-discord.sh failed "Bone Kingdom Deploy Failed" 15158332
|
|
when:
|
|
status: [failure]
|