From f793f2623b761f1df5596fbd5c05264991a6b3f3 Mon Sep 17 00:00:00 2001 From: PxlLoewe <72106766+PxlLoewe@users.noreply.github.com> Date: Tue, 8 Jul 2025 23:21:22 -0700 Subject: [PATCH] prod deploy --- .github/workflows/deploy-production.yml | 49 +++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/deploy-production.yml diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml new file mode 100644 index 00000000..b513f944 --- /dev/null +++ b/.github/workflows/deploy-production.yml @@ -0,0 +1,49 @@ +name: Deploy to Production +on: + pull_request: + types: [closed] + branches: + - release + workflow_dispatch: + +jobs: + deploy: + if: github.event.pull_request.merged == true && github.event.pull_request.head.ref == 'staging' + name: Deploy to Production + 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 release + 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: | + export NVM_DIR="$HOME/.nvm" + source "$NVM_DIR/nvm.sh" + cd ~/docker/var-monorepo/packages/database + pnpm exec 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: | + export NVM_DIR="$HOME/.nvm" + source "$NVM_DIR/nvm.sh" + cd ~/docker/var-monorepo + pnpm staging-start