-
Notifications
You must be signed in to change notification settings - Fork 9
49 lines (40 loc) · 1.67 KB
/
development.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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/[email protected]
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
git checkout -f
git pull origin main
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 }}/pages/main/home'
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_start_script
EOF