Add Staging CD

This commit is contained in:
PxlLoewe
2025-07-08 22:59:46 -07:00
parent da26634422
commit 64267792b3

41
.github/workflows/deploy-staging.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: Deploy to Staging
on:
push:
branches:
- staging
jobs:
deploy:
name: Deploy to Staging
runs-on: ubuntu-latest
steps:
- name: Pull latest code
uses: appleboy/ssh-action@v1
with:
host: ${{ vars.STAGING_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: 22
script: |
cd ~/docker/var-monorepo
git checkout staging
git pull
- name: Deploy migration to Database
uses: appleboy/ssh-action@v1
with:
host: ${{ vars.STAGING_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: 22
script: |
cd ~/docker/var-monorepo/packages/database
npx prisma migrate deploy
- name: Build and start containers
uses: appleboy/ssh-action@v1
with:
host: ${{ vars.STAGING_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: 22
script: |
cd ~/docker/var-monorepo
pnpm staging-start