From 64267792b34815df7bf00d2448db7979363a3c7b Mon Sep 17 00:00:00 2001 From: PxlLoewe <72106766+PxlLoewe@users.noreply.github.com> Date: Tue, 8 Jul 2025 22:59:46 -0700 Subject: [PATCH] Add Staging CD --- .github/workflows/deploy-staging.yml | 41 ++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/deploy-staging.yml diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml new file mode 100644 index 00000000..fd0c1b3d --- /dev/null +++ b/.github/workflows/deploy-staging.yml @@ -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