Files
frontend_v2/.gitea/workflows/deploy.yml
Workflow config file is invalid. Please check your config file: yaml: line 3: could not find expected ':'

28 lines
933 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: deploy
on:
<<<<<<< HEAD
# 手动触发:在 Gitea 仓库 Actions 页面点「Run workflow」才部署,
# 避免每次 push 到 main 的半成品代码被自动上线。
=======
>>>>>>> 29c2d77a8585ff20a7ed193cd45a7a291c63befe
workflow_dispatch:
jobs:
deploy:
runs-on: docker
steps:
- name: SSH deploy
shell: sh
env:
KEY_B64: ${{ secrets.DEPLOY_KEY_B64 }}
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
run: |
set -e
apk add --no-cache openssh-client >/dev/null 2>&1 || true
mkdir -p "$HOME/.ssh"
echo "$KEY_B64" | base64 -d > "$HOME/.ssh/id"
chmod 600 "$HOME/.ssh/id"
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i "$HOME/.ssh/id" \
"$DEPLOY_USER@$DEPLOY_HOST" "cd /opt/fashion/backend_v2 && ./deploy.sh web --no-cache"