Skip to content

Merge branch 'pr/54' into development #20

Merge branch 'pr/54' into development

Merge branch 'pr/54' into development #20

Workflow file for this run

name: Deploy to dev.cyb.no
on:
push:
branches:
- development
jobs:
deploy:
runs-on: ubuntu-latest
environment: 'ISV2 deployment'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up SSH connection
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.TEMP_SERVER_SSH_PRIVATE_KEY }}
- name: Connect and deploy
run: |
ssh -o StrictHostKeyChecking=no ${{ vars.TEMP_SERVER_USER }}@${{ vars.TEMP_SERVER_ADDRESS }} << 'EOF'
cd internsystem-v2-dev
git checkout -f
git pull origin development
cat <<'EOT' > .env.production
DATABASE_URL = 'mysql://${{ secrets.DATABASE_USER }}:${{ secrets.DATABASE_PASSWORD }}@localhost:3306/${{ secrets.DATABASE_NAME }}'
NEXTAUTH_URL = '${{ vars.NEXTAUTH_URL }}'
NEXTAUTH_CALLBACK = '${{ secrets.NEXTAUTH_URL }}/'
NEXTAUTH_SECRET = '${{ secrets.NEXTAUTH_SECRET }}'
NEXTAUTH_GITHUB_CLIENT_ID = '${{ vars.NEXTAUTH_GITHUB_CLIENT_ID }}'
NEXTAUTH_GITHUB_CLIENT_SECRET = '${{ secrets.NEXTAUTH_GITHUB_CLIENT_SECRET }}'
NODEMAILER_NOREPLY_USER = '${{ secrets.NODEMAILER_NOREPLY_USER }}'
NODEMAILER_NOREPLY_PASSWORD = '${{ secrets.NODEMAILER_NOREPLY_PASSWORD }}'
NEXT_PUBLIC_SANITY_API_VERSION = '${{ vars.NEXT_PUBLIC_SANITY_API_VERSION }}'
NEXT_PUBLIC_SANITY_DATASET = '${{ vars.NEXT_PUBLIC_SANITY_DATASET }}'
NEXT_PUBLIC_SANITY_PROJECT_ID = '${{ vars.NEXT_PUBLIC_SANITY_PROJECT_ID }}'
EOT
npm install
npx prisma generate
npm run build
npx pm2 restart ISV2_dev
EOF