Skip to content

wip: 评论来自信息 #9

wip: 评论来自信息

wip: 评论来自信息 #9

Workflow file for this run

name: deployment
on:
push:
branches: ["prod"]
jobs:
build:
runs-on: ubuntu-latest
env:
DATABASE_URL: ${{ secrets.database_url }}
DOCKER_NAME: blog
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: |
npm install
npm run build
npx prisma migrate deploy
- uses: cross-the-world/ssh-scp-ssh-pipelines@latest
with:
host: 121.40.126.12
user: root
pass: ${{ secrets.ssh_password }}
connect_timeout: 10s
first_ssh: |
rm -rf /app/service/blog
scp: |
./.output/* => /app/service/blog
last_ssh: |
docker rm -fv $DOCKER_NAME
docker run -d -v /app/service/blog:/app -e PORT=7100 -e DATABASE_URL=$DATABASE_URL --name $DOCKER_NAME -p 7100:7100 node node /app/server/index.mjs