53 lines
1.7 KiB
YAML
53 lines
1.7 KiB
YAML
name: Deploy to Server
|
|
on: [push]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Stop old containers
|
|
uses: https://gitea.com/actions/appleboy-ssh-action@v1.0.3
|
|
with:
|
|
host: 6.6.6.66
|
|
username: quant
|
|
password: 123quant-speed
|
|
script: |
|
|
cd /home/quant/data/dev/deploy 2>/dev/null && echo "123quant-speed" | sudo -S docker compose down 2>/dev/null || true
|
|
|
|
- name: Upload files
|
|
uses: https://gitea.com/actions/appleboy-scp-action@v0.1.4
|
|
with:
|
|
host: 6.6.6.66
|
|
username: quant
|
|
password: 123quant-speed
|
|
source: "."
|
|
target: "/home/quant/data/dev/deploy"
|
|
|
|
- name: Start containers
|
|
uses: https://gitea.com/actions/appleboy-ssh-action@v1.0.3
|
|
with:
|
|
host: 6.6.6.66
|
|
username: quant
|
|
password: 123quant-speed
|
|
script: |
|
|
cd /home/quant/data/dev/deploy
|
|
mkdir -p backend
|
|
cat > backend/.env <<'EOF'
|
|
DB_NAME=scoring
|
|
DB_USER=quant-speed
|
|
DB_PASSWORD=123quant-speed
|
|
DB_HOST=6.6.6.66
|
|
DB_PORT=5432
|
|
ALIYUN_ACCESS_KEY_ID=LTAI5tE62GW8MKyoEaotzxXk
|
|
ALIYUN_ACCESS_KEY_SECRET=Zdzqo1fgj57DxxioXOotNKhJdSfVQW
|
|
ALIYUN_OSS_ENDPOINT=https://oss-cn-shanghai.aliyuncs.com
|
|
ALIYUN_OSS_BUCKET_NAME=tangledup-ai-staging
|
|
ALIYUN_OSS_INTERNAL_ENDPOINT=https://oss-cn-shanghai-internal.aliyuncs.com
|
|
ALIYUN_TINGWU_APP_KEY=6eOX7N3tKE0fDwb
|
|
DASHSCOPE_API_KEY=sk-84e9eef24a274f568d4fa15c97556c9f
|
|
EOF
|
|
echo "123quant-speed" | sudo -S docker compose up -d --build
|