Add Staging CD
This commit is contained in:
41
.github/workflows/deploy-staging.yml
vendored
Normal file
41
.github/workflows/deploy-staging.yml
vendored
Normal 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
|
||||
Reference in New Issue
Block a user