Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
FoundTheWOUT committed Mar 9, 2023
1 parent 574f4af commit ae79751
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Deploy Node.js app

on:
push:
branches: [main]
paths:
- "packages/server/**/*.ts"

jobs:
deploy:
name: Deploy to server
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Deploy server
uses: appleboy/ssh-action@master # 使用第三方操作来执行 SSH 命令
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.PASSWORD }}
script_stop: true
script: | # 执行部署相关的脚本
cd /root/15-music
git pull
sudo docker-compose build --build-arg version=$(git rev-parse --short HEAD)
sudo docker-compose up -d server --no-deps

1 comment on commit ae79751

@vercel
Copy link

@vercel vercel bot commented on ae79751 Mar 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.