Skip to content

Fix prisma

Fix prisma #20

Workflow file for this run

name: Deploy App
on:
push:
branches:
- main # or your deployment branch
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Copy repository to SFTP
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SFTP_HOST }}
username: ${{ secrets.SFTP_USER }}
password: ${{ secrets.SFTP_PASSWORD }}
port: ${{ secrets.SFTP_PORT }}
source: '.'
target: '/opt/route'
- name: Build and deploy Docker container
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SFTP_HOST }}
username: ${{ secrets.SFTP_USER }}
password: ${{ secrets.SFTP_PASSWORD }}
port: ${{ secrets.SFTP_PORT }}
script: |
cd '/opt/route'
# Overwrite the .env file to recreate it during each deployment
rm -f .env
echo "AUTH_SECRET=${{ secrets.AUTH_SECRET }}" >> .env
echo "CLIENT_ID=${{ secrets.CLIENT_ID }}" >> .env
echo "CLIENT_SECRET=${{ secrets.CLIENT_SECRET }}" >> .env
echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" >> .env
echo "AUTH_TRUST_HOST=${{ secrets.AUTH_TRUST_HOST }}" >> .env
#Prisma
npx prisma generate
docker build -t route .
docker stop route || true
docker rm route || true
docker run -d --name route --restart always -p 3002:3000 route